Title: Validating with external entities and schemas 1.4.4 vs 2.3.0
For more on the same problem, see my unanswered emails in the archives...
 
To save you some pain:
Basically, schema does not address physical doc items like entities...they are like word-processor macros that live in the physical world, not the logical.
 
Schema addresses the logical doc, so entities beyond the built-in must be pre-processed out by you before the parser ever sees the file.
 
My guess is that the mutant "combo" document worked with old versions of the parser by pure luck.  Unfortunately, the default parser in XML Spy also parses these Frankensteins without errors, giving you the illusion that you might be able to use such a thing in production.
 

Walt Fitzharris

-----Original Message-----
From: Stottlemyer, Carl [mailto:[EMAIL PROTECTED]
Sent: Friday, February 21, 2003 9:19 AM
To: [EMAIL PROTECTED]
Subject: Validating with external entities and schemas 1.4.4 vs 2.3.0

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>

Reply via email to