Subject: Re: [xsl] preceding-sibling::node() apply template -xsl:copy From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Mon, 16 Apr 2012 22:05:46 -0400 |
Hi All, I am using a xslt identity transform and I have one more template to manipulate "EVENTHEADER" header. I am not sure ,how to do exclude the " xmlns:ns2="uri" attribute in the output using the preceding-sibling::node() apply template.
<ns2:local xmlns:ns2="uri"><EVENTHEADER>
<xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>
<xsl:template match="EVENTHEADER[EVENT_TYPE]"> <xsl:copy>
<xsl:template match="@*|text()|comment()|processing-instruction()"> <xsl:copy/> </xsl:template>
<xsl:template match="*"> <xsl:element name="{name(.)}"> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template>
<xsl:apply-templates select="EVENT_TYPE[position() < 2]/preceding-sibling::node()" /> < EVENT_TYPES> <xsl:apply-templates select="EVENT_TYPE[position() < 2]" /> </EVENT_TYPES> <xsl:apply-templates select="EVENT_TYPE[last()]/following-sibling::node()" /> </xsl:copy> </xsl:template>
Input: <ns2:local xmlns:ns2="uri"><EVENTHEADER>
Actual output: <EVENTHEADER xmlns:ns2="uri">
Expected output: <EVENTHEADER> </EVENTHEADER >
Any pointer would be really helpful.
-- Public XSLT, XSL-FO, UBL and code list classes in Europe -- May 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@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] preceding-sibling::node() app, Senthilukvelaan | Thread | Re: [xsl] preceding-sibling::node(), Michael Kay |
[xsl] preceding-sibling::node() app, Senthilukvelaan | Date | [xsl] Implementing unparsed-entity-, Dan Vint |
Month |