Subject: RE: RE: [xsl] extrat value from current node only. From: cknell@xxxxxxxxxx Date: Wed, 30 Mar 2005 07:54:41 -0500 |
When I received my posting via email the character entities for CR/LF and TAB were replaced by the literal characters making this reply unintelligible. What should appear between the first set of single quotes in the argument to the translate() function are: o a space (you can simply hit the space bar) o the character entity representing a CR/LF which is: ampersand, #, 10, ; o the character entity representing a TAB which is: ampersand, #, 9, ; There should be no whitespace or separator characters between these three. -- Charles Knell cknell@xxxxxxxxxx - email -----Original Message----- From: cknell@xxxxxxxxxx Sent: Wed, 30 Mar 2005 07:42:17 -0500 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] extrat value from current node only. Add this template: <xsl:template match="description" /> It will prevent the default template from outputting the content of the <description> element other than when you call it explicitly with :<xsl:value-of select="description"/>. Change this: <xsl:value-of select="current()"/> to this: <xsl:value-of select="translate(text(),' ','')"/> I will strip out the CR/LF and the TAB characters you don't want by replacing them with empty strings. -- Charles Knell cknell@xxxxxxxxxx - email -----Original Message----- From: emmanuel ide <emmanuel@xxxxxxxxxxx> Sent: Wed, 30 Mar 2005 13:05:37 +0100 To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: [xsl] extrat value from current node only. Hi Guys, My fist post on this mailing list. Just started learning xsl yesterday, and already come across an issue which I cannot solve with the W3C tutorial ... : Below are my xml & xls file: ________________ XML FILE _______________________ <?xml version="1.0" encoding="UTF-8" ?> <items> <item> title 1 <description>description 1</description> </item> <item> title 2 <description>description 2</description> </item> </items> _________________________________________________ ________________ XLS FILE _______________________ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="items"> <xsl:apply-templates select="item"/> </xsl:template> <xsl:template match="item"> title:<xsl:value-of select="current()"/> description:<xsl:value-of select="description"/> </xsl:template> </xsl:stylesheet> ___________________________________________________ I don't get <?xml version="1.0" encoding="UTF-8"?> title:title 11 description:description 1 But ... <?xml version="1.0" encoding="UTF-8"?> title: title 1 description 1 description:description 1 title: title 2 description 2 description:description 2 What changes do I have to make to my xls file to get the output I want? Thank you for you help. Emmanuel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] extrat value from curren, emmanuel ide | Thread | RE: [xsl] extrat value from curren, emmanuel ide |
RE: [xsl] extrat value from curren, cknell | Date | RE: [xsl] extrat value from curren, emmanuel ide |
Month |