[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: unparsed CDATA maintain HTML
Hmmm... could you post a bit more elaborate version of the source and desired target? Yes thanks I attach it at the end ... Just having a bit of difficulty seeing the problem here. If I try a template with xsl:copy-of, this gives me an identical copy of the source node it is being used on, including attributes, sorry that was my fault with some early tries of xsl:copy and, if specified correctly in the source document, it will also copy the namespace and respective prefixes. I would really appreciate your help specifying them correctly in this case: part of the XML file: <?xml version = "1.0" encoding = "UTF-8"?> <doc> <text> This is some <i>italic</i> and a table <table align="center"><tr><td>hello</td></tr></table></text> </doc> So now I understand that the following stylesheet <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xalan="http://xml.apache.org/xalan" xmlns:om="http://www.openmath.org/OpenMath" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl" version="1.0"> <xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/> <xsl:template match="/"> <html> <xsl:apply-templates/> </html> </xsl:template>
does produce a copy of the text element with the <i>s and <tables>s etc appropriately copied but I have this problem with the xmlns <text xmlns=""> This is some <i>italic</i> and a table <table align="center"><tr><td>hello</t </tr></table></text> which is only avoided if one uses namespaces for the HTML element. Also I am not sure if I want to keep this <text> element there (maybe its name should be changed if possible to something more xthml-ish or better I did:
... <xsl:template match="font"> <xsl:copy-of select="."> </xsl:copy-of> </xsl:template> but this would mean that I need to write templates for alll possible HTML elements ? (which i will at some point when I clearly specify my XML files but this is another story) Could we find a way round that and instead of copying text create a new element say <span xmlns="..."> ... </span> That would have the copy of the text element of the first XML file .. something like copying into differnt namespaces ? I hope I make sense ... I am rather excausted goodnight George ps. This reminds me the reason that I use CDATA as this dirty bit of XML there is like a hack as th DTD doesn't allow HTML elements :-) but that's another issue _________________________________________________________________ Tired of 56k? Get a FREE BT Broadband connection http://www.msn.co.uk/specials/btbroadband XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|