Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Ignoring parseable XHTML without CDATA tag

  • 07-02-2006 12:19PM
    #1
    Closed Accounts Posts: 658 ✭✭✭


    Hi

    Im having a small problem with parsing an XML file. It goes something like this.

    [HTML]
    <main>
    <title>This is a title</title>
    <h1>This is a heading</h1>
    <p>Paragraph containing lists
    <ul>
    <li class="attribute">List element</li>
    <li class="attribute">Another list element</li>
    </ul>
    </p>
    </main>
    [/HTML]
    Now, when I try to output this using XSL, the text is output minus the tags. My XSL looks like this

    [HTML]
    <xsl:value-of select="main/title"/>
    [/HTML]

    and the output looks like

    [HTML]
    This is a title

    This is a heading

    Paragraph containing lists

    List element
    Another list element
    [/HTML]

    I want the XSL processor to output exactly what it looks like in the XML. If there any other way I can do this ? I have searched google but the examples don't provide me with exactly what I need to do. I am fairly new to XSL and already its melting my head :(


Comments

  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    post the xml file pls


  • Closed Accounts Posts: 658 ✭✭✭pontovic


    I cant post the original XML file unfortunately. Its work sensitive data and I could get in trouble for doing so. It has basically the same format as the one shown above, and it has no CDATA tags. XML with embedded CDATA tags tells the parser to treat what is in between these tags just as text, not as parsable XML tags.


Advertisement