Subject: Re: [xsl] Matching processing-instructions From: Geert Bormans <geert@xxxxxxxxxxxxxxxxxxx> Date: Mon, 08 Oct 2012 08:18:19 +0200 |
xml: <foo> <?foo bar?> </foo>
xslt: <xsl:template match="foo"> <xsl:apply-templates/> </xsl:template> <xsl:template match="processing-instruction()"> <xsl:copy-of select="."/> </xsl:template>
result: <?foo bar?>
The reference Philipp added talks about the built-in template It means that you need to have a template for the process-instruction() But you were already having that
Hi Karl,
no, <xsl:apply-templates/> does not hit PIs. You have to use processing-instruction() or node() (also hits element, text, PI and comment nodes).
Philipp
PS: See also section 5.8 in http://www.w3.org/TR/xslt:
"The built-in template rule for processing instructions and comments is to do nothing."
Am 08.10.2012 08:06, schrieb Karl Stubsjoen:Is an <xsl:apply-templates/> going to hit on child processing instructions matches, or do I need to specifically select them like: <xsl:apply-templates select="processing-instructions()"/>
<xsl:template match="processing-instrunction()"> .. do something .. </xsl:template>
Karl..
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Matching processing-instr, Karl Stubsjoen | Thread | Re: [xsl] Matching processing-instr, Glatza, Philipp, le- |
Re: [xsl] Matching processing-instr, Karl Stubsjoen | Date | Re: [xsl] Matching processing-instr, Glatza, Philipp, le- |
Month |