[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Empty nodes - more informative
you have to be more specific with your templates i think. When you match "*" you're matching at one point the <topic> node whose value is <topic> <a>Hello</a> <b code="123"/> <c/> </topic> Because not(string(.)) means "the string value of the current node is an empty string", when this test is applied to the topic node it fails because the string value of the topic node is <topic> <a>Hello</a> <b code="123"/> <c/> </topic> at some point in the output, it'll get down to <b code="123"/> whose string value is "", and not put it out twice, but by then it will have already processed, or be about to process (dont know what order * match goes in...) the <topic> node which will output the whole <topic> <a>Hello</a> <b code="123"/> <c/> </topic> I could be wrong about this... > I try with this : > <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0"> > <xsl:output method="xml" indent="yes" omit-xml-declaration="no"/> > > <xsl:template match="/"> > <xsl:apply-templates/> > </xsl:template> > > <xsl:template match="*"> > <xsl:choose> > <xsl:when test="not(string(.))"/> > <xsl:otherwise> > <xsl:copy-of select="."/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> > > </xsl:transform> > > but <b code="123/> and <c/> are still in the output. > > Benoit. > > > -----Original Message----- > > From: Dominic J. Blythe [mailto:Dominic.Blythe@xxxxxxxxxxxxxxx] > > Sent: 04 July 2001 13:40 > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > Subject: RE: Empty nodes - more informative > > > > > > try not(string(.)) > > > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > > > > > ************************************************************ > JLT Management Services Limited > 6 Crutched Friars, London EC3N 2PH. Co Reg No 1536540 > Tel: (44) (0)20 7528 4000 Fax: (44) (0)20 7528 4500 > http://www.jltgroup.com > ------------------------------------------------------------ > The content of this e-mail (including any attachments) as > received may not be the same as sent. If you consider that > the content is material to the formation or performance of > a contract or you are otherwise relying upon its accuracy, > you should consider requesting a copy be sent by facsimile > or normal mail. The information in this e-mail is > confidential and may be legally privileged. If you are not > the intended recipient, please notify the sender immediately > and then delete this e-mail entirely - you must not retain, > copy, distribute or use this e-mail for any purpose or > disclose any of its content to others. > > Opinions, conclusions and other information in this e-mail > that do not relate to the official business of JLT > Management Services Limited shall be understood as neither > given nor endorsed by it. Please note we intercept and > monitor incoming / outgoing e-mail and therefore you should > neither expect nor intend any e-mail to be private in nature. > > We have checked this e-mail for viruses and other harmful > components and believe but not guarantee it virus-free prior > to leaving our computer system. However, you should satisfy > yourself that it is free from harmful components, as we do > not accept responsibility for any loss or damage it may > cause to your computer systems. > ************************************************************ > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|