Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

CDATA in XSL

  • 01-09-2005 11:03am
    #1
    Closed Accounts Posts: 658 ✭✭✭


    Hi

    I have a quick question. Basically, at the top of every output file I produce from an input XSL file, i want to print out the XML declaration tag, like this:

    <?xml version="1.0" encoding="ISO-8859-1"?>

    So I put this into my XSL file

    <![CDATA[
    <?xml version="1.0" encoding="ISO-8859-1"?>
    ]]>

    and it appears like so in the output produced:

    "<?xml version="1.0" encoding="ISO-8859-1"?>"

    I've tried a few things like not including the cdata tag and putting in things like &lt and &quot to see could I work it that way.

    Any ideas ?


Comments

  • Closed Accounts Posts: 25 dan_pretty_boy


    Hi pontivic,

    instead of useing CDATA

    why dont you just use <xsl:output method="xml" indent="yes" />


    danny


  • Closed Accounts Posts: 658 ✭✭✭pontovic


    thanks dan

    ill try that now and see how i get on


  • Closed Accounts Posts: 658 ✭✭✭pontovic


    unfortunately that didnt work, but thanks for the help :)


  • Closed Accounts Posts: 658 ✭✭✭pontovic


    Hi

    I managed to find out what to do.

    You need to put in

    <xsl:output method="xml" omit-xml-declaration="no"/>

    near the top of the XSL file for it to output an XML declaration tag at the top of the output file. Put it just after the XSL declaration tag (<xsl:version="2.0"....etc>), and any import statements you have (<xsl:import href=filename....>). That should help any new people like me to XSL who have similar trouble.


Advertisement