[jdom-interest] Toward beta 9
Alex Rosen
arosen at novell.com
Wed Apr 9 08:37:35 PDT 2003
We discussed this quite a bit a year ago:
http://www.servlets.com/archive/servlet/BrowseList?listName=jdom-interest&by=subject&from=74264
My philosophy was that protecting people from themselves is great when
it's cheap, but in this case it's not. Elliotte feels that it should be
impossible to create a document that's not 100% well-formed, even if
that's expensive to check. (And to achieve that goal will get quite a
bit more expensive - e.g. we'd need to read each referenced DTD and
parse it, to make sure that entity referenences have been declared and
are not circular.)
My proposed solution was to make the verifier a separate, optional
step. When the user creates a document in-memory (as opposed to parsing
a file), then should run the verifier on it when they're done. Many
people won't do this, and that's their prerogative, but at some point
down the line some XML parser will find the error when their document
gets parsed, so it's not the end of the world. (That's why the parser is
required to be so strict, IMO - so the generator doesn't have to be.)
Jason proposed a compromise solution: verify names but not values,
which is likely to be relatively cheap. E.g. verify element and
attribute names but not attribute values or text content. This is what
DOM does. (dom4j doesn't verify anything, at least as of a year ago.)
Alex Rosen
Novell, Inc.
>>> <Vadim.Strizhevsky at morganstanley.com> 4/9/2003 10:25:03 AM >>>
Hi,
I raised this issue recently about Verifier, but I don't think anyone
responded. Currently Virifier runs both when you building the message
"by
hand" and when it comes from SAX parser. Howerver when it comes from
SAX
parser it is really unecessary, as it is XML parser responsibility to
verify character set. All valid XML parsers including Xerces and
Crimson
do this. So Verifier is just doing the same work again and in a less
efficient way and adds significant overhead. Is it possible that JDOM
can
do something so that Verifier is not used when message is constructed
from
XML parser?
Thanks,
-Vadim
On Wed, 9 Apr 2003, Bradley S. Huffman wrote:
> Elliotte Rusty Harold writes:
>
> > >Verifier check for ProcessingInstruction's setData()? Elliotte can
we borrow
> > >the check out of XOM's Verifier?
> > >
> >
> > Sure. I officially grant the JDOM permission to republish that
check
> > under the JDOM license rather than the LGPL.
>
> Got love open source :)
>
> Hmmm, it looks like this is the last set method that didn't have a
call
> to a check in Verifier. After this check is added, does that cover
all
> the XML spec. constaints that can be checked in Verifier and can we
cross
> that item off the TODO list?
>
> Brad
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
>
>
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
More information about the jdom-interest
mailing list