Page 1 of 1

XML Schema and CDATA

Posted: Mon Jul 18, 2005 2:11 pm
by miami
Hi a newbie question I hope someone can help!

I'm working with the following Data:

<record>
<title><![CDATA[A Game Title]]></title>
</record>

I have created a schema file for the xml and a stylesheet for users to edit the data.

Unfortunately the text between the ![CDATA[...]] tags is not showing up in the stylesheet. Taking the CDATA tags out of the xml is not an option.

I think the problem is in the schema rather than the xsl. Has anyone any ideas how I can fix this problem?

Cheers

Posted: Mon Jul 18, 2005 4:01 pm
by george
Hi,

The XSL data model does not contain CDATA, the XSLT processor will see no difference when you pass it as input the follosing XML:

Code: Select all


<record>
<title>A Game Title</title>
</record>
That is the XSLT procesor will see a text node there. CDATA is only a syntax feature that allows you to write some special characters unescaped, for instance you can write < inside a CDATA section while outside of it you need to escape it as <

Best Regards,
George

Posted: Mon Jul 18, 2005 6:02 pm
by miami
Hi,

I should really have been more specific in my original post, I'm using XMLSpy and Altova Authentic to view the completed style sheets. The content appears in the HTML view but not in the Authentic view which is what I need to use.

If the xsl doesn't see the CDATA tags why does the content within these tags not show up?

I'm now attempting to try to edit the xsl:output directive to see if this will force the content to show. :?

Thanx

M

Posted: Mon Jul 18, 2005 7:28 pm
by george
Maybe you should try then asking on the support channels for that product, we are not familiar with that so I cannot imagine how it deals with CDATA sections.

Good luck :wink: !

George

Posted: Tue Jul 19, 2005 11:43 am
by miami
Will do!

Thanks for your help :)