Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT and special characters

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
I have an application here that allows the easy creation of XML documents.

But some of these documents are actually scripts to be imported into flash, which cant handle & and < etc..

so I need to write some code to parse my xml documents, and output a flash readable version, by wrapping the & into a CDATA[&] section

Now the only xslt debugger I have handy is XMLSpy, and that complains that my code <xsl:value select="![CDATA[&]]"> contains illegal characters, or is not well formed.

any help appreciated,

K
 
Why are you using XML?

CDATA cannot go in the value-of element like that. Where you want to include the script, use:
Code:
<xsl:text disable-output-escaping="yes"><![CDATA[&]]></xsl:text>

Jon

"I don't regret this, but I both rue and lament it.
 
XML is a requirement of the project, I got called in at the last minute, so I dont know the history.

Jonty, using

<xsl:text disable-output-escaping="yes"><![CDATA[&]]></xsl:text>

looks ok, but when you parse the code, it seems to be automatically converted to &amp; again !

any more ideas?

Cheers
K
 
What are you actually converting? Are you importing XML into flash or are you simply outputting the script from and XML file? Post your XML and desired output.

Jon

"I don't regret this, but I both rue and lament it.
 
Sorry for not being clear.
The flash website script files are all created in xml format. This works surprisingly well, considering the xml support in flash!

But what we have is
Code:
<body>This is some sample text &amp; here is some more</body>
what we need to present to the flash is

Code:
<body>This is some sample text & here is some more</body>
K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top