|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Insert HTML Page into XML CDATA Tag
> I have a very big problem. > I create a little web site and I use XSL + XML to produce > output.Now I > want to add a part of html page into xml tag to use a custom > page section. > But i find a problme, > > see the example : > > I use this xml : > > <resources> > <html><![CDATA[<B>Hello World</B>]]></html> > </resources> > The purpose of CDATA is to tell the XML parser that the <B> is to be treated as ordinary character data, not as markup. In your case you want it treated as markup. So why are you putting it in CDATA? Perhaps it's HTML rather than XML, so you can't nest it directly. The best answer to that is to make the HTML into XHTML. But OK, you can't always do that when you have lots of legacy HTML. To deal with that messy situation, XSLT provides a messy tool: it's called disable-output-escaping="yes". Use it only when you are desparate, and can't find a proper design solution to the requirement. Michael Kay Software AG home: Michael.H.Kay@n... work: Michael.Kay@s... >
|
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
|
|||||||||

Cart








