You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Er...@Classwell.com on 2002/01/18 17:54:55 UTC

Schema and character entities

Does anyone have a good solution for validating xml containing character
entities with schema? I'm using xerces2 (beta4).

I'm trying to move a system from DTD to schemas where the content makes
heavy use of character entities. I'd prefer not to have to make changes to
the content to make this possible, short of adding xmlns:xsi and
xsi:schemaLocation attributes to the root node, and (perhaps) chaning or
removing the DOCTYPE declaration.

The XML Schema: Last-Call Issues
(http://www.w3.org/2000/05/12-xmlschema-lcissues.html) contains a call for
support of character entities which is rejected (LC-91)  On solution to
this offered is to specify entities in an entity-only DTD (the DTD
resolution resolves them before the schema gets a hold of them). I've tried
this, but since I can't perform shcema validation without DTD validation,
this fails--xerces needs the DTD to properly define the document. Including
the full DTD is problematic, both in terms of the inefficiency of the
redundant validation, and the fact that xerces complains

"xmlns"  "xmlns:xsi" and "xsi:schemaLocation" not being in my DTD.

Having to add these to my DTD feels even more kludgy. But so far this the
only way I can make schema validation on files with character entities
work.

Has anyone come up with better solution?

I'm current turning on Validation and NamespaceAware (on the
DocumentBuilderFactory) and enabling the features
"http://apache.org/xml/features/validation/schema",
http://apache.org/xml/features/validation/schema-full-checking" (and turing
off "http://apache.org/xml/features/dom/defer-node-expansion" but that's
another story).
Are there any other features or properties that might help?

Thanks,

Eric







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