This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Error "(StylesheetHandler) xsl:value-of not allowed inside a stylesheet"


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@bmc.com 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]