  | |  | Validating with external entities and schemas 1.4.4 vs 2.3.0 | Validating with external entities and schemas 1.4.4 vs 2.3.0 2003-02-21 - By Stottlemyer, Carl
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>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2656.27"> <TITLE>Validating with external entities and schemas 1.4.4 vs 2.3.0</TITLE> </HEAD> <BODY>
<P><FONT SIZE=2 FACE="Arial">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.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Thanks, Carl</FONT> </P>
<P><FONT SIZE=2 FACE="Arial"><?xml version="1.0" encoding=" ;UTF-8" ?></FONT> <BR><FONT SIZE=2 FACE="Arial"><!-- leagues are validated against the league .xsd schema.</FONT> <BR><FONT SIZE=2 FACE="Arial">The DOCTYPE is included to provide ENTITY references to embedded xml files</FONT> <BR><FONT SIZE=2 FACE="Arial">--></FONT> <BR><FONT SIZE=2 FACE="Arial"><!DOCTYPE league[</FONT> <BR><FONT SIZE=2 FACE="Arial"> <!ELEMENT league ANY>< /FONT> <BR><FONT SIZE=2 FACE="Arial"> <!ENTITY team1 SYSTEM " ;someUrl"> </FONT> <BR><FONT SIZE=2 FACE="Arial"> <!ENTITY team2 SYSTEM " ;someUrl2"> </FONT> <BR><FONT SIZE=2 FACE="Arial">]></FONT> <BR><FONT SIZE=2 FACE="Arial"><leauge xmlns="<A HREF="http: //www.myLeague.com" TARGET="_blank">http://www.myLeague.com</A>"</FONT> <BR><FONT SIZE=2 FACE="Arial"> xmlns:xsi="<A HREF="http://www.w3.org /2001/XMLSchema-instance" TARGET="_blank">http://www.w3.org/2001/XMLSchema -instance</A>"</FONT> <BR><FONT SIZE=2 FACE="Arial"> xsi:schemaLocation="<A HREF="http:/ /www.myLeague.com" TARGET="_blank">http://www.myLeague.com</A></FONT> <BR> <FONT SIZE=2 FACE="Arial"> someUrl3 "></FONT> <BR><FONT SIZE=2 FACE="Arial">&team1;</FONT> <BR><FONT SIZE=2 FACE="Arial">&team2;</FONT> <BR><FONT SIZE=2 FACE="Arial"></league></FONT> </P>
</BODY> </HTML>
|
|
 |