Thanks for the explanation. I am realizing that my perspective towards schema's and xml was wrong. I allways took the approach where the schema was leading: "this is my schema so come up with that xml and I will validate it". This way I thought to have maximum control and making a simple solution. But in fact I was swimming against the stream because the XML itself determines the way it should be handled. You can see this also with tools like XMLSpy which let you change the xmlsource to validate against another schema or DTD. So I will take another approuch which is more in line with Xerces . Today I have tested a lot with the xerces SAXParser and an EnityResolver2. And I have simple question. I am putting in this XML: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tempuri.org/po.xsd C:\Temp\Schemas\apo.xsd"> The entityresolver2 gets the following callbacks: getExternalSubset (name purchaseOrder baseURI null) resolveEntity name null publicId null baseURI null systemId C:\Temp\Schemas\apo.xsd getExternalSubset name xs:schema baseURI file:///C:/Temp/Schemas/apo.xsd So getExternalSubset is always called; the second time it comes form the loaded schema. Also the baseURI is null in the first because I did don specify a systemid to the xml inputSource. This is all clear to me. But I wonder about values in the resolveEntity. I thought I also should have the namespace http://tempuri.org/po.xsd available in one of the parameters (I supposed in name or publicid). But I only get the systemID. It seams to me that the namespace is a very relevant value for determing the right inputsource you will give back. Also the doc says about the name: name - Identifies the external entity being resolved. Either "[dtd]" for the external subset, or a name starting with "%" to indicate a parameter entity, or else the name of a general entity. This is never null when invoked by a SAX2 parser. Am I missing something? And can I just open a URL connection to the given systemid to check if the parser will resolve the entry. Or should I combine this with the baseUri if not null? Op 7-jul-2006, om 7:12 heeft Michael Glavassevich het volgende geschreven:
|
- Using grammarpool with included schemas Dick Deneer
- Re: Using grammarpool with included schemas Michael Glavassevich
- Re: Using grammarpool with included schemas Dick Deneer
- Re: Using grammarpool with included sche... Joseph Kesselman
- Re: Using grammarpool with included ... Dick Deneer
- Re: Using grammarpool with incl... Michael Glavassevich
- Re: Using grammarpool with ... Dick Deneer
- Re: Using grammarpool w... Michael Glavassevich
- Re: Using grammarpool with included schemas Michael Glavassevich
- Re: Using grammarpool with included schemas Michael Glavassevich
