Subject: Re: [xsl] Creating namespace nodes From: omprakash.v@xxxxxxxxxxxxx Date: Tue, 7 Jun 2005 16:49:32 +0530 |
Hi, I'd too would like to see the workaround (not producing 100% the desired output so far ) once again so I can save it to my collection. (Or I guess the better option would be to check the archive ). Regards, Omprakash.V Mukul Gandhi <mukul_gandhi@ To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx yahoo.com> cc: (bcc: omprakash.v/Polaris) Subject: Re: [xsl] Creating namespace nodes 06/07/2005 04:12 PM Please respond to xsl-list Hi George, I got the same output that you have written .. Accidently some nodes from the XML got deleted, while I hit the send button .. I'll study Tomi's stylesheet .. Regards, Mukul --- George Cristian Bina <george@xxxxxxx> wrote: > Hi Mukul, > > With Saxon 8.4 I get: > > <?xml version="1.0" encoding="UTF-8"?> > <a id="10"> > <b id="9"> > <c id="8"> > <d id="7"> > <a id="5"> > <h > xmlns:ns0="http://whatever" ns0:temp="" > id="6"/> > </a> > </d> > </c> > </b> > </a> > > which looks ok to me. Note that it is not what you > have as desired > output as you do not include there the temp > attribute. > > Best Regards, > George > --------------------------------------------------------------------- > George Cristian Bina > <oXygen/> XML Editor, Schema Editor and XSLT > Editor/Debugger > http://www.oxygenxml.com > > > Mukul Gandhi wrote: > > I am using XSLT 1.0 ;) > > > > "I need to write a identity transform, and add a > > namespace node to a particular element in the > result > > tree.." > > > > I have written the following XSLT (1.0) stylesheet > so > > far .. > > > > <?xml version="1.0"?> > > <xsl:stylesheet > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > > version="1.0"> > > > > <xsl:output method="xml" indent="yes" /> > > > > <xsl:template match="node() | @*"> > > <xsl:copy> > > <xsl:apply-templates select="node() | @*" /> > > </xsl:copy> > > </xsl:template> > > > > <xsl:template match="h"> > > <xsl:copy> > > <xsl:attribute name="temp" > > namespace="http://whatever" /> > > <xsl:apply-templates select="node() | @*" /> > > </xsl:copy> > > </xsl:template> > > > > </xsl:stylesheet> > > > > The input XML is - > > > > <?xml version="1.0"?> > > <a id="10"> > > <b id="9"> > > <c id="8"> > > <d id="7"> > > <a id="5"> > > <h id="6" /> > > </a> > > </d> > > </c> > > </b> > > </a> > > > > The output produced with the above stylesheet is - > > > > Warning: Running an XSLT 1.0 stylesheet with an > XSLT > > 2.0 processor > > <?xml version="1.0" encoding="UTF-8"?> > > <a id="10"> > > <b id="9"> > > <c id="8"> > > <d id="7"> > > <a id="5"> > > <h temp: id="6"/> > > > > </a> > > </d> > > </c> > > </b> > > </a> > > > > I am using Saxon 8.4 .. > > > > I desire output - > > > > <?xml version="1.0" encoding="UTF-8"?> > > <a id="10"> > > <b id="9"> > > <c id="8"> > > <d id="7"> > > <a id="5"> > > <h > > xmlns:temp="http://whatever" id="6"/> > > </a> > > </d> > > </c> > > </b> > > </a> > > > > I'll appreciate any help .. > > > > Regards, > > Mukul > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit Us at http://www.polaris.co.in
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Creating namespace nodes, tomas.vanek | Thread | RE: [xsl] Creating namespace nodes, tomas.vanek |
RE: [xsl] Creating namespace nodes, tomas.vanek | Date | Re: [xsl] Creating namespace nodes, Mukul Gandhi |
Month |