Subject: [xsl] Re: [xml-dev] XSLT Stylesheet test for special character From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 22 Jan 2009 22:31:05 +0900 |
Hello,
( 4 ) <xsl:value-of select="ns:strong"/>
does not do anything, except dumping the text content of ns:strong into the output. If you want to use that value, you have to set a variable with that, like :
<xsl:variable name="value" select="ns:strong/text()"/>
Try that with a XSLT debugger,
see what you have in that variable, and then you can try something like :
<xsl:when test="contains($value, 'Firstname:')">
Be aware that if you do text() when current node is <ns:p> (you previously did <xsl:for-each select="/ns:html/ns:body/ns:div[@id='content']/ns:p">), you obtain the concatenation of recursively applying text() on all the children node of <ns:p> so you will have white spaces, content of markup <a>, etc...
Use a debugger ! (Oxygen has a great one)
-- Upcoming XSLT/XSL-FO, UBL and code list hands-on training classes: : Sydney, AU 2009-01/02; Brussels, BE 2009-03; Prague, CZ 2009-03 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Optimizing identity templ, Michael Kay | Thread | [xsl] disappearing line breaks with, cavecatem@xxxxxxxxxx |
Re: [xsl] Re: Re-arranging an XML f, David Carlisle | Date | [xsl] disappearing line breaks with, cavecatem@xxxxxxxxxx |
Month |