ul's again, almost there

Discussion in 'XML' started by adMjb, Aug 22, 2005.

  1. adMjb

    adMjb Guest

    I think I am almost there, with help from Johannes Koch (thank you)
    last week:
    http://groups.google.co.uk/group/comp.text.xml/browse_thread/thread/b7f55bf554ee288d?hl=en

    ==========================
    So now I have this XSL:
    ==========================
    <xsl:template match="text">
    <p>
    <xsl:apply-templates/>
    </p>
    </xsl:template>
    <xsl:template match="bullet[1]">
    <ul>
    <xsl:apply-templates select=".|following-sibling::bullet"
    mode="first"/>
    </ul>
    </xsl:template>
    <xsl:template match="bullet" mode="first">
    <li>
    <xsl:apply-templates/>
    </li>
    </xsl:template>
    <xsl:template match="bullet">
    <xsl:text disable-output-escaping="yes"/>
    </xsl:template>

    ==========================
    This XML:
    ==========================
    <root>
    <text>
    1 text here
    </text>
    <bullet>
    a bullet
    </bullet>
    <bullet>
    b bullet
    </bullet>
    <bullet>
    c bullet
    </bullet>
    <text>
    2 text here
    </text>
    <bullet>
    d bullet
    </bullet>
    <bullet>
    e bullet
    </bullet>
    </root>
    ==========================
    But the bullets (a,b,c,d,e) end up merged with no space for the text
    (1) in the middle?

    Can someone help, many thanks
     
    adMjb, Aug 22, 2005
    #1
    1. Advertisements

  2. adMjb

    adMjb Guest

    I mean text (2)

    But the bullets (a,b,c,d,e) end up merged with no space for the text
    (2) in the middle?
     
    adMjb, Aug 22, 2005
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.