[jdom-commits] CVS update: jdom/src/java/org/jdom
jhunter at cvs.jdom.org
jhunter at cvs.jdom.org
Sun Jul 23 10:55:40 PDT 2000
Date: Sunday July 23, 2000 @ 18:55
Author: jhunter
Update of /home/cvspublic/jdom/src/java/org/jdom
In directory www.nmemonix.com:/tmp/cvs-serv25486
Modified Files:
Verifier.java
Log Message:
Elliotte writes:
I've attached a new version of Verifier. I added checks for
isXMLCharacter() that tests whether a specified character is or is
not allowed in parsed data. Basically it allows everything except C0
controls, surrogates, and a few other things disallowed by Production
2. For instance we should not be allowing vertical tabs or formfeeds
in element content. It can be used to check the text content of an
XML element or attribute value, and indeed I've added a method to
check a string to see if it's legal to place in parsed character data
as well.
If you'd like I can go ahead and rewrite Element, Attribute, and the
others to make these checks. They're not nearly as nasty (not nearly
as many branches) as the checks for whether a character is a legal
name or name start character. If they prove to be a performance hit,
then I have some ideas about how we could make them less onerous, but
I'd rather write them the simple way first.
I also ran some tests where I generated elements beginning with all
legal namestart characters (except the colon) and containing all
legal name characters (again the colon excepted). I serialized these
into a file and ran Xerces's sax.SAXCount across it. This turned up a
few bugs which I fixed. After these fixes, Xerces accepts any element
Verifier allows. I have not yet figured out how to run the test in
the other direction, that is to make sure that JDOM accepts all
element names Xerces allows, but it shouldn't be hard.
I also rewrote checkXMLName() to depend on isXMLNamestartCharacter().
The revised Verifier is attached.
===================================================================
File: Verifier.java Status: Up-to-date
Working revision: 1.11 Sun Jul 23 17:55:40 2000
Repository revision: 1.11 /home/cvspublic/jdom/src/java/org/jdom/Verifier.java,v
Existing Tags:
start (revision: 1.1.1.1)
jdom (branch: 1.1.1)
More information about the jdom-commits
mailing list