Loading ...
Sorry, an error occurred while loading the content.
 

Re: [msv-interest] Re: TheFactoryImpl

Expand Messages
  • James Strachan
    Sorry for the delay getting back to you - but this sounds great. James ... From: Kohsuke KAWAGUCHI To: msv-interest@yahoogroups.com Sent: Friday, December 21,
    Message 1 of 9 , Jan 13, 2002
      Sorry for the delay getting back to you - but this sounds great.

      James
      ----- Original Message -----
      Sent: Friday, December 21, 2001 4:39 PM
      Subject: [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
      Schema/RELAX NG/Schematron.

      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
         Reader.

      2. Use BufferedInputStream/BufferedReader to wrap the original
         InputStream/Reader.

      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?


      regards,
      --
      Kohsuke Kawaguchi



      To unsubscribe from this group, send an email to:
      msv-interest-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
    Your message has been successfully submitted and would be delivered to recipients shortly.