Subject: [xsl] Applying lists outside of paragraphs From: "Spencer Tickner" <spencertickner@xxxxxxxxx> Date: Wed, 20 Sep 2006 09:53:51 -0800 |
Thanks in advance for the help. I'd like to blame this one on Monday, except for the fact that it isn't...
I'm attempting to apply-templates to my paragraph elements and then apply-templates to my list elements as the list elements are currently embedded in the paragraph elements.
<?xml version="1.0"?> <para.appl>Blah Blah <term>foo</term> to <term>bar</term> for <term>foo</term>, Blah Blah: <list.appl> <listitem.appl>Bullet 1</listitem.appl> <listitem.appl>Bullet 2 <term refid="wtr-tm">bar</term></listitem.appl> </list.appl> </para.appl>
<?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <xsl:apply-templates/> </xsl:template>
<!-- This is the weird Part --> <xsl:template match="para.appl"> <p><xsl:apply-templates select="*[not(descendant-or-self::list.appl)]"/></p> <xsl:apply-templates select="list.appl"/> </xsl:template>
<xsl:template match="list.appl"> <ul> <xsl:apply-templates/> </ul> </xsl:template>
<xsl:template match="listitem.appl"> <li><xsl:apply-templates/></li> </xsl:template>
<xsl:template match="term"> <em><xsl:apply-templates/></em> </xsl:template>
<p><em>foo</em><em>bar</em><em>foo</em></p><ul> <li>Bullet 1</li> <li>Bullet 2 <em>bar</em></li> </ul>
<p>Blah Blah <em>foo</em> to <em>bar</em> for <em>foo</em>, Blah Blah:</p> <ul> <li>Bullet 1</li> <li>Bullet 2 <em>bar</em></li> </ul>
I can't quite figure out why <xsl:apply-templates select="*[not(descendant-or-self::list.appl)]"/> does not want to apply the default text() template. I've also tried no axis, child::, descendant:: and even self:: but none give the desired output... Any ideas? I'm using Saxon 8.7.1
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] REPOST - duplicate footno, Ann Marie Rubin \(an | Thread | Re: [xsl] Applying lists outside of, Wendell Piez |
[xsl] Newbie ? - dynamic linking tw, Jeremy Patterson | Date | Re: [xsl]   appearing as ? in F, Joe Fawcett |
Month |