[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Insert HTML Page into XML CDATA Tag

  • To: xml-dev@l...
  • Subject: Insert HTML Page into XML CDATA Tag
  • From: Pietro Venanzangeli <pietro.venanzangeli@a...>
  • Date: Fri, 05 Apr 2002 14:47:32 +0200
  • User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1

xml cdata
Hi Guy
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>

trasform xml with xsl page
and my output into html browser is &lt;B&gt;Hello World&lt;/B&gt;
my  BOLD html tag is not parse by browser  because xslt parser trasform 
my special tag into other tag. I want obtin this output :
<b>Hello World</b>

Can you help me ?


this is my trasformation function :

private Transformer getXSLTransformer (xslFile) throws 
XSLTransformerConfigurationException {
    try {
        Transformer transformer = null;
        tFactory = TransformerFactory.newInstance();
        transformer = tFactory.newTransformer(new 
StreamSource(xslFile)); // load xslFile from disk
    } catch (TransformerConfigurationException tce) {
        throw new XSLTransformerConfigurationException(tce.getMessage());
    }
    return transformer;
}

public String myTrasform(String xml,String xslFile) throws Exception {
    StringWriter outputString = new StringWriter(512);
    Transformer transformer = getXSLTransformer (xslFile);
    transformer.transform(new StreamSource(new StringReader(xml)), new 
StreamResult(outputString));                  
    return outputString.toString();
}

Thank's in advance.



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.