xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Labhard <mlabh...@viatraining.com>
Subject Re: XMLReader.parse
Date Fri, 22 Sep 2000 15:02:05 GMT
To clarify:

	I have a class that imports the following
...
import org.xml.sax.*;
import com.icl.saxon.ParserManager;
import com.icl.saxon.ExtendedInputSource;

and I have a method that at some point makes the following calls:
		...

		XMLQueryFilter filt = new XMLQueryFilter( (Parser)ParserManager.makeParser() );

		filt.setDocumentHandler( new XMLOutputter( sw ) );

		filt.parse( new ExtendedInputSource(xml) );
		
		...

To explain these objects see:

public class XMLQueryFilter extends ParserFilter
{
	...

public abstract class ParserFilter
	implements Parser, AttributeList,
	DocumentHandler, DTDHandler, EntityResolver, ErrorHandler {
		...

I was hoping that the call "filt.parse(..." would be resolved to the
Parser.parse( InputSource i ) method but it is not.  It is being resolved to
Parser.parse( java.lang.String systemid ) method instead.  Since "xml" is a
string containing XML and not a file path an error occurs of course.  How do I
encourage it to find the other method?  The method is present in the SAXDriver
of saxon.  Thanks.


> I want to call SAXParser.parse( InputSource i ) because the SAXParser
> implements XMLReader but whenever I make this call the call is resolved to
> SAXParser.parse( URL i ).  I have tried both the saxon and the xerces
> SAXParser's.  My need is to provide the xml document as a character stream, not
> as a file.  Any help?  Thanks.

Mime
View raw message