[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[xsl] Child locations
Subject: [xsl] Child locations From: Luke Jones <ljones@xxxxxxxxxx> Date: Wed, 25 Apr 2007 15:33:00 -0500 |
XSL Experts -- I'm trying to prevent the first occurrence of a child tag from line breaking. So for example I have the following xml: <law> <section> <amended> <catchline>This is the title</catchline> <para>This is paragraph 1</para> <para>This is paragraph 2</para> <para>This is paragraph 3</para> </amended> </section> </law> I would want the output after running the xsl to look similar to this: This is the title. This is paragraph 1 This is paragraph 2 This is paragraph 3 Currently what I've tried in my xsl is this: <xsl:template match="amended/para"> <xsl:for-each select = "child::node()"> <xsl:choose> <xsl:when test="child::node()[not(.=normalize-space(.))][1][self::para] <fo:inline> <xsl:value-of select = "." /> </fo:inline> </xsl:when> <xsl:otherwise> <fo:block> <xsl:value-of select = "."/> </fo:block> </xsl:otherwise> </xslchoose> </xsl:for-each> </xsl:template> I think the "<xsl:when test = "child::node()[not(.=normalize-space(.))][1][self::para]" is what is wrong. I've tried looking up all the pieces of this segment of code, but have no real understanding what it is doing. It is something I pulled from a mail list archive. Thanks for any and all help!
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] (newbie) Need DOCTYPE com, Glen Mazza | Thread | Re: [xsl] Child locations, David Carlisle |
Re: [xsl] Copying parent nodes with, Abel Braaksma | Date | Re: [xsl] Child locations, David Carlisle |
Month |
Keywords