[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to move processing instruction?
Hi,
It is not clear what the logic of the transformation is so I will just assume that what you want is to move the processing instructions that are in the source before the root element inside the div element. In that case you can start with the recursive copy template and add a couple of rules to avoid copying PIs that are children of the document node and to copy then inside the div element: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="node() | @*"/> </xsl:copy> </xsl:template> <xsl:template match="/"> <xsl:apply-templates select="*"/> </xsl:template> <xsl:template match="div"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:apply-templates select="/processing-instruction()"/> <xsl:apply-templates select="node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com J. S. Rawat wrote: Dear Expert(s): Could anybody help me to get the following results:
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|