[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Error "(StylesheetHandler) xsl:value-of not allowed inside a
Hi all, I am new to xml/xslt technologies. I developed a servlet that takes a xml file and a xsl file as sources and produces the result into its response object's PrintWriter. However, I am getting the following error message, "(StylesheetHandler) xsl:value-of not allowed inside a stylesheet". Here is my code: Inside my servlet, I have: //MyServlet.java public void XMLHelloWorld(PrintWriter _out) throws java.io.IOException, org.xml.sax.SAXException { XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); XSLTInputSource xmlSource = new XSLTInputSource ("e://Programs/Apache_JServ 1.1/servlets/foo.xml"); XSLTInputSource xslSheet = new XSLTInputSource ("e://Programs/Apache_JServ 1.1/servlets/foo.xsl"); XSLTResultTarget xmlResult = new XSLTResultTarget(_out); xmlResult.setEncoding("text/html"); // Perform the transformation. processor.process(xmlSource, xslSheet, xmlResult); } //foo.xml <?xml version="1.0"?> <doc>Hello</doc> //foo.xsl <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <html> <head> <title> </title> </head> <body bgcolor="#ffffff"> <h1><xsl:value-of select="doc"/></h1> </body> </html> </xsl:stylesheet> I am getting "(StylesheetHandler) xsl:value-of not allowed inside a stylesheet" error. Any help would be appreciated. Thanks. Micheal huan_loh@xxxxxxx 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
|