Hi,

I am having major problems transforming XML to HTML with XSLT. We are doing
this from a Servlet - this works fine when the XML does not contain any
SYSTEM Entities, but when we put in an entity referring to another XML file
it ceases to work.
We are using Xalan 2.0.1 and Xerces 1.3.1

Below is the example XML files and XSL file and the Servlet code snippet. 

The code falls over at the tFactory.newTransformer(xslSource) with the
following exception:

javax.xml.transform.TransformerConfigurationException: File "null" not found

We have tried a variety of methods of creating the transformer object going
through the TransformerFactory and through the Templates object and none of
them seem to work properly.

XSL FILE:
  <?xml version="1.0" ?> 
- <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:variable name="this" select="/" /> 
  <xsl:output method="html" /> 
- <xsl:template match="/">
- <html>
- <head>
  <title>Test Page</title> 
  </head>
- <body>
- <p>
  This is a test: 
  <br /> 
- <b>
- <i>
- <u>
  <xsl:value-of select="article" /> 
  </u>
  </i>
  </b>
  </p>
  </body>
  </html>
  </xsl:template>
  </xsl:stylesheet>

XML FILE - with entity reference:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="/xsl/test.xsl"?>

<!DOCTYPE test [

        <!ENTITY news SYSTEM "/xml/test.xml">
]>

<article>&news;</article>

XML FILE - that the entity refers to:
<?xml version="1.0" encoding="ISO-8859-1"?>
This is a test

SERVLET CODE:
System.out.println("xsl: "+xslSource);
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(xslSource);
transformer.transform(xmlSource, new
StreamResult(response.getOutputStream()));


The code doesn't get past the creation of the 
Transformer object.
Any help will be greatfully received!!!


Regards,

Darren


Darren Morris
Technical Consultant
Valtech (UK) Ltd
Corinthian House
279 Tottenham Court Road
London
W1T 7RJ


Tel:    +44 (0)20 7307 2300
Fax:    +44 (0)20 7307 2301
Mob:    +44 (0)771 316 3377
www.valtech.co.uk



DISCLAIMER: This e-mail contains Proprietary information some or all of
which may be legally privileged. It is for the intended recipient only.  If
an addressing or transmission error has misdirected this e-mail, please
notify the author by replying to this e-mail. If you are not the intended
recipient you must not disclose, distribute, copy, print or rely on this
e-mail. All information contained within this e-mail is subject to the Terms
& Conditions of Valtech Ltd. which are available upon request. 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to