xsl-list
[Top] [All Lists]

Re: [xsl] Child locations

2007-04-25 15:21:29

Thanks David!

That got me going on the right track.

-Luke

On Wed, 2007-04-25 at 21:42 +0100, David Carlisle wrote:
I'm trying to prevent the first occurrence of a child tag from line

XSLT has no access to the tags in a document, you mean child element.


 <xsl:template match="amended/para">
this will only match teh para, some other code may or may not match your
catchline but you don't show it.

                <xsl:for-each select = "child::node()">
this is the same as
                <xsl:for-each select = "node()">

and selects all child nodes of the current para, in your exaple this is
always a single text node.

<xsl:when test="child::node()[not(.=normalize-space(.))][1][self::para]
the first sterp of this is selcting all child nodes of teh current text
nodes, text nodes never have any children so thi sset will always be
empty and test as false.

I think you want something like

<xsl:template match="ammended">
  <xsl:apply-templates select="para"/>
</xsl:template>

<xsl:template match="para">
<fo:block>
<xsl:if test="position()=1">
<fo:inline>
<xsl:apply-templates select="preceding-sibling::catchline"/>
<xsl:text> </xsl>text>
</fo:inline>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:template>

David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>