[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Need help with XSLT: adding new node btw existing
David: I tried this but in the output, i notice that the namespace gets added as attributes to the environment as well as variable elements. Is there way that can be avoided? xslt - <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:b="blabla"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="node() | @*" /> </xsl:copy> </xsl:template> <xsl:template match="b:environment"> <environment> <variable id="SAROOTDIR" value="D:\Dir1"/> <variable id="SADATADIR" value="D:\Dir2"/> </environment> </xsl:template> </xsl:stylesheet> and the output looks like - <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="C:\test1.xslt"?> <test xmlns="blabla"> <comp id="New"> <process-type id="home"> <environment xmlns="" xmlns:b="blabla"> <variable xmlns="" id="SAROOTDIR" value="D:\Dir1"/> <variable xmlns="" id="SADATADIR" value="D:\Dir2"/> </environment> </process-type> </comp> </test> Thanks! On 8/16/06, David Carlisle <davidc@xxxxxxxxx> wrote:
|
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
|