Validating with external entities and schemas 1.4.4 vs 2.3.0 2003-02-21 - By sandygao@(protected)
Xerces 1.4.4 use a unified validator for both DTD and Schema, so it was easier to tell which kind of validation needs to be performed.
In Xerces2, we have separate validators, so things became a little harder. The result is that there is way in Xerces2 to say "I only want schema validation". What you can do is to use the JAXP 1.2 schema-language property.
Cheers, Sandy Gao Software Developer, IBM Canada (1-905) 413-3255 sandygao@(protected)
"Stottlemyer, Carl" To: xerces-j-user@(protected) .apache.org <carl.stottlemyer cc: @(protected)> Subject: Validating with external entities and schemas 1.4.4 vs 2.3.0 02/21/2003 09:18 AM Please respond to xerces-j-user
I have a document with structure similar to the xml below. When I use Xerces 1.4.4, I am able to validate the document against the schema without any problems. When I use Xerces 2.3.0 the validation tells me that all of the elements in each of the entities need to be defined (however they are defined in the schema.) It appears to me that the xerces is searching the DTD for the ANY elements without referencing the schema. Any explanation as to why it works in 1.4.4 and not 2.3.0. I would also appreciate any recommendations as to what I need to do to make it work in 2.3.0.
Thanks, Carl
<?xml version="1.0" encoding="UTF-8" ?> <!-- leagues are validated against the league.xsd schema. The DOCTYPE is included to provide ENTITY references to embedded xml files --> <!DOCTYPE league[ <!ELEMENT league ANY> <!ENTITY team1 SYSTEM "someUrl"> <!ENTITY team2 SYSTEM "someUrl2">
]> <leauge xmlns="http://www.myLeague.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.myLeague.com someUrl3"> &team1; &team2; </league>
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|