Hi,
Quote:
quote:Originally posted by suri
Have a problem.Ã Ã I have a XML file which has a tag <Document> </Document>, that holds a CDATA.Ã Ã This CDATA holds the information in a particular format.Ã When I transform this xml file to html using a xsl file, I need to display in the same format as it is XML.
|
It will be nice to see the content of the element "Document". If the content is a well-balanced XML snippet(that is, after adding a parent element to the content, the resulting stuff becomes a well-formed XML document), then it's strange that you wrapped the content into CDATA section. In this case you can simply remove the CDATA section delimiters and use xsl:copy-of to deep-copy the content. If you have no control over the source XML(e.g., it's dynamically generated), or the content of the element contains also DTD stuff, Saxon 7.6.5 offers saxon:parse(string) extension function, which parses the argument, and returns document node if the argument represents well-formed XML; otherwise it reports an error. You can get the root node returned by this function and then use xsl:copy-of instruction to deep-copy the content.
Hope this will help.
Regards,
Armen