Hi Jeff,

I understand this, but I would like to stop the validation process (which, I believe, will run through the entire document resolving entities BEFORE using my SAX ContentHandler Interface) from accessing DTDs and schemas on unknown machines.

The only way I can think of doing this would be to parse the document twice - first with validation off so I can spot any "unapproved" namespaces. If all namespaces are OK, I can then parse the document again with validation on. This seems like a bit of a waste of time!

I guess what I am really looking for is a flag which will tell the parser to validate ONLY namespaces specifically given in xsi:schemaLocation directives, and not try to find a schema/DTD for any other namespaces.

 

Andy

>From: "Jeff Greif" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: <[EMAIL PROTECTED]>
>Subject: Re: Can I stop SAX validation from resolving non-approved namespaces?
>Date: Tue, 15 Apr 2003 09:52:37 -0700
>
>No. The xsi:schemaLocation attribute is just a hint to the parser about where to find the schema. If you attach an EntityResolver to the parser (in its constructor, or by some method like setEntityResolver) you have complete control of how any URIs are looked up. You can resolve particular namespaces to your fixed copy of the schemas in question (and can make local copies of common ones found on the Internet to avoid redundant network activity).
>
>Jeff
> ----- Original Message -----
> From: Andy Taylor
> To: [EMAIL PROTECTED]
> Sent: Tuesday, April 15, 2003 8:07 AM
> Subject: Re: Can I stop SAX validation from resolving non-approved namespaces?
>
>
> Hi Joseph,
>
> Wouldn't this mean I would have to write my own version of the validate function?
>
> Andy
>
>
>
> >From: Joseph Kesselman
> >Reply-To: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >Subject: Re: Can I stop SAX validation from resolving non-approved namespaces?
> >Date: Tue, 15 Apr 2003 11:00:56 -0400
> >
> >Write and install an entity resolver which filters such requests. That's
> >also what you'd have to do to guard yourself against entity references.


Message your friends in real time - and for free. Get MSN Messenger today! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to