You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Arnaud Le Hors <le...@us.ibm.com> on 2000/12/01 18:42:03 UTC

Re: Non-validating parse causes presence of the DTD to be...

Luke Blanshard wrote:
> 
> "David H. Cook" wrote:
> 
> >      And, I've now found what appears to be a bug in Xerces parser,
> > relating to how it handles the reference to the DTD that can be
> > present in an XML stream.
> 
> No, unfortunately the parser MUST read external DTDs, so it can pick up default
> attribute values, etc.  This is mandated by the spec, even.

That's not true. All parsers must read the INTERNAL subset, but non
validating parsers can completely ignore the external subset.

We currently only have a validation on/off feature but we really need an
additional feature allowing to turn off external DTD reading. Obviously
when validation is turned on, the other would be on too. But when
validation is off the application could choose whether to read the
external subset or not. When non validating, reading the DTD can still
be useful to get the default attributes, entity declarations, attribute
types (affect normalization and IDs handling), as well as "ignorable
whitespace" info.
This has been on my list of things to look at for a long time. Maybe I
could finally get it done next week...
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group



Re: Xml Over Http Question

Posted by Brent L Johnson <br...@bjohnson.net>.
I'm parsing and validating documents that are posted to an HTTP server, but
I'm not handling session information.  But, here is what I'm doing...

....
InputStream in = request.getInputStream();
InputSource source = new InputSource(in);
DOMParser parser = new DOMParser();
parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion",
false);
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://xml.org/sax/features/namespaces", true);
parser.setFeature("http://apache.org/xml/features/validation/schema", true);
parser.setErrorHandler(this);
parser.parse(source);
....

Don't know if this will help, but I gave it a shot ;)

- Brent

----- Original Message -----
From: "Scott Carter" <sc...@dotsconnect.com>
To: <xe...@xml.apache.org>
Sent: Wednesday, December 20, 2000 1:54 PM
Subject: Xml Over Http Question


>
> I'm using the Xerces XmlSerializer class to serialize XML documents to and
> from an HttpServlet.  For some strange reason, this is screwing up my
> server's(weblogic) session tracking mechanism and it is creating a new one
> each time a user comes in.  Has anyone had this problem before or know how
> to resolve it?
>
>
> Also, I've also noticed that if I create a session and then try to parse a
> document, in this order, I get an error from the parser about the stream
> being closed before the whole document can be read.  If I do this in
reverse
> order, it seems to work most of the time, however, its a little quirky.
Has
> anyone experienced this problem?
>
> -----Original Message-----
> From: Arnaud Le Hors [mailto:lehors@us.ibm.com]
> Sent: Wednesday, December 06, 2000 8:52 PM
> To: xerces-j-dev@xml.apache.org
> Subject: Re: Non-validating parse causes presence of the DTD to be...
>
>
> All right, I did it. I implemented this afternoon a new feature called:
> http://apache.org/xml/features/nonvalidating/load-external-dtd
>
> When this and validation is off the external subset isn't fetched at
> all. It's checked in and will be part of the new release that Jeff is
> wrapping up.
> Enjoy! :-)
> --
> Arnaud  Le Hors - IBM Cupertino, XML Technology Group
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


Xml Over Http Question

Posted by Scott Carter <sc...@dotsconnect.com>.
I'm using the Xerces XmlSerializer class to serialize XML documents to and
from an HttpServlet.  For some strange reason, this is screwing up my
server's(weblogic) session tracking mechanism and it is creating a new one
each time a user comes in.  Has anyone had this problem before or know how
to resolve it?


Also, I've also noticed that if I create a session and then try to parse a
document, in this order, I get an error from the parser about the stream
being closed before the whole document can be read.  If I do this in reverse
order, it seems to work most of the time, however, its a little quirky.  Has
anyone experienced this problem?

-----Original Message-----
From: Arnaud Le Hors [mailto:lehors@us.ibm.com]
Sent: Wednesday, December 06, 2000 8:52 PM
To: xerces-j-dev@xml.apache.org
Subject: Re: Non-validating parse causes presence of the DTD to be...


All right, I did it. I implemented this afternoon a new feature called:
http://apache.org/xml/features/nonvalidating/load-external-dtd

When this and validation is off the external subset isn't fetched at
all. It's checked in and will be part of the new release that Jeff is
wrapping up.
Enjoy! :-)
--
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: Non-validating parse causes presence of the DTD to be...

Posted by Arnaud Le Hors <le...@us.ibm.com>.
All right, I did it. I implemented this afternoon a new feature called:
http://apache.org/xml/features/nonvalidating/load-external-dtd

When this and validation is off the external subset isn't fetched at
all. It's checked in and will be part of the new release that Jeff is
wrapping up.
Enjoy! :-)
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

Re: Non-validating parse causes presence of the DTD to be...

Posted by Luke Blanshard <lu...@quiq.com>.
Arnaud Le Hors wrote:

> I wrote:
> > No, unfortunately the parser MUST read external DTDs, so it can pick up default
> > attribute values, etc.  This is mandated by the spec, even.
>
> That's not true. All parsers must read the INTERNAL subset, but non
> validating parsers can completely ignore the external subset.

Whoops, I stand corrected.  My apologies for adding to the confusion level!

Luke