xsl-list
[Top] [All Lists]

Re: [xsl] Processing instructions not getting inserted?

2012-06-20 14:45:14
At 2012-06-20 14:41 -0500, russurquhart1(_at_)verizon(_dot_)net wrote:
I was trying to put in some processing instructions used by our CMS into some xml. The processing instructions are of a form for an Insertion mark tag:

<?xm-insertion_mark_start author="x0167021" time="20120618T161651-0600"?>
<?xm-insertion_mark_end?>

When i tried doing something like the following:

<xsl:template match="*[@filter='filter1']">
<?xm-insertion_mark_start author="x0167021" time="20120618T161651-0600"?>
 <xsl:copy-of select="."/>
<?xm-insertion_mark_end?>
 </xsl:template>

Or something like this:

<xsl:template match="*[@filter='filter1']">
<xsl:text><?xm-insertion_mark_start author="x0167021" time="20120618T161651-0600"?></xsl:text>
 <xsl:copy-of select="."/>
<xsl:text><?xm-insertion_mark_end?></xsl:text>
 </xsl:template>

I get the copy of the element, but NONE of the processing instruction text.

Is the XSLT processor (I'm using Saxon) interpreting the processing instructions?

No, all processing instructions in the stylesheet are ignored.

Do i need to do something different to get this text to be inserted.

<xsl:processing-instruction name="xm-instertion_mark-start"
>author="x0167021" time="20120618T161651-0600"</xsl:processing-instruction>
<xsl:copy-of select="."/>
<xsl:processing-instruction name="xm-instertion_mark-end"/>

If you need to calculate the name, it is an attribute value template so you can use brace brackets for XPath expressions.

I hope this helps.

. . . . . . . Ken


--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>