Re: [msv-interest] Re: TheFactoryImpl
- Sorry for the delay getting back to you - but this sounds great.
James----- Original Message -----From: Kohsuke KAWAGUCHISent: Friday, December 21, 2001 4:39 PMSubject: [msv-interest] Re: TheFactoryImpl
> I was only really thinking of XML-based schemas and that the first
> element of an XML schema usually describes which schema it is. I think
> DTDs should always be treated seperately. Maybe having a VerifierFactory
> method just for DTDs in the API might be worthwhile.
There are other problems with DTD, but I feel a lot of people are
considering XML Schema/RELAX NG/Schematron as something alternative to
DTD. So it would be nice if we can treat DTD as if it's the same as XML
And even if we forget about DTD, we still need to "rewind" the stream
because JARV doesn't support SAX-based schema parsing right now.
So here is my plan:
1. JARV accepts many different inputs: InputStream, File, String (as
url),etc. But all of them are eventually converted to InputStream or
2. Use BufferedInputStream/BufferedReader to wrap the original
3. Then mark it before read any byte/char
4. Try to parse it as an XML with non-validating parser.
5. if it receives the startElement event, it must be an XML-based
grammar. Use the tag name to figure out the language, reset the
stream, hand it to the appropriate JARV implementation
6. if it fails to parse XML document, reset the stream and hand it to
the DTD implementation.
Do you think it works?
To unsubscribe from this group, send an email to:
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.