Hi guys,
I have a doubt to move the element into perticular position, mentioned the example as below,
<date> element should be move after the element <host>, Is it possible to do in xslt 2.0??
Input Sample:
Code:
<reference id="ref011">
<host>
<book>
<title>
<maintitle>College bound seniors</maintitle>
</title>
<date>1980</date>
<publisher>
<location>Princeton (NJ)</location>: <name>College Board Publications</name>; </publisher>
</book>
</host>
</reference>
Output Sample:
Code:
<reference id="ref011">
<host>
<book>
<title>
<maintitle>College bound seniors</maintitle>
</title>
<publisher>
<location>Princeton (NJ)</location>: <name>College Board Publications</name>; </publisher>
</book>
</host><date>1980</date>
</reference>
Attempt XSLT 2.0:
Code:
<xsl:template match="//host/book/date">
<xsl:if test="./following-sibling::publisher">
<xsl:copy-of select="//host/date"/>
</xsl:if>
</xsl:template>
Please help me anybodies....