Hi Samina,

Instead of using XSLTProcessor.process, you should use the
XSLT processor as a SAX ContentHandler, and give it to
SAXParser.setContentHandler before calling SAXParser.parse
to perform the parse. That way the parser will "push" the
XML into the XSLT engine, which is good because that way
you are in control of the parser being used.

The way you are currently calling it, the XSLT engine will
"pull" the XML out of a parser, and it will not use the
parser you set up (you haven't told it about that parser),
but instead construct its own (either using JAXP or by
first attempting to instantiate Xerces and just using JAXP
if Xerces isn't present).

I hope that explains it! By the way, it sounds like you
are using Xalan 1 with the direct interface. You should
really consider migrating to Xalan 2 and using the TrAX
interface to the XSLT engine (see the usage examples at
http://xml.apache.org/xalan-j/usagepatterns.html ) and the
JAXP interface to the parser. They make life so simple! :)
(and faster and with less bugs, and currently supported!)

Cheers,

        - Gulli



-----Original Message-----
From: Samina Islam [mailto:[EMAIL PROTECTED]]
Sent: 30. j�l� 2001 18:20
To: [EMAIL PROTECTED]
Subject: entity


Hi All!

I'm using xalan/xerces to take in some XML documents and using XSL
stylesheet turn them into a PRISM document.  All the XML documents I'm using
has a doctype at the beginning.  I do not want xerces/xalan to connect to
this site.  This is why I'm using setEntityResolver() method.  In my main, I
have this:

SAXParser parser = new SAXParser();
NonResolveEntityResolver resolver = new NonResolveEntityResolver();
parser.setEntityResolver(resolver);

XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
// Have the XSLTProcessor processor object transform "page5.xml"to
// System.out, using the XSLT instructions found in "moreover.xsl".

processor.process(new XSLTInputSource("page5.xml"),new
XSLTInputSource("moreover.xsl"),new XSLTResultTarget("feed3.xml"));
System.out.println("************* The result is in feed3.xml*************");

This is not working.  How can I let the XSLT processor know of the parser?
Thanks!

Samina

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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


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

Reply via email to