Dick Deneer <[EMAIL PROTECTED]> wrote on 07/07/2006 05:36:29 PM: > Ok, if that's all I will do that, but it was more the principal that > I do not want to know how the schema is resolved b the parser, I only > want to know if it was successful or not.
It's not an implementation detail. The API doc for EntityResolver.resolveEntity() [1] says precisely what happens: "SAX specifies how to interpret any InputSource returned by this method, and that if none is returned, then the system ID will be dereferenced as a URL". Saving the one line of code "new java.net.URL(systemId).openStream()" just doesn't seem like a good enough reason to add a new property. > Still I believe the support for schema resolving is less compared to > DTD's. For DTD's you get all you want publicid systemid or name of > the root. All are also keys for the grammarpool. For schemas you get > nothing. The most important thing (the namespace, also used as key in > the grammarpool, which also is a indication of importance) lacks. > This makes it very hard to return your own inputsource. SAX's EntityResolver was only designed for resolving external entities (the external DTD subset, external parameter entities and external general entities). If you want the target namespace for the schema you should use an API which has a resolver that will pass that information (see the JAXP 1.3 Validation API and LSResourceResolver [2]) to you. For more info you should also take a look at: http://issues.apache.org/jira/browse/XERCESJ-1158 where this issue was last discussed. > Op 7-jul-2006, om 23:08 heeft Michael Glavassevich het volgende > geschreven: > > > Dick Deneer <[EMAIL PROTECTED]> wrote on 07/07/2006 > > 04:00:09 PM: > > > >> You may be theorically right, but it is obvious that it would be very > >> practical to have it available together with the systemid in the > >> entityResolver. Returning a schema with another namespace is just > >> useless. > >> > >> And in continuing about my question if the parser will resolve the > >> entity by itself or not, I will suggest for another property where > >> you van set a kind of finalResolver with the same method as > >> resolveEntity, that wil get a callback if the parser did not find the > >> entity. Then you get a last chance to resolve it yourself. > > > > I don't see the need for this. You already get a chance in your > > EntityResolver and it can try opening an InputStream from the > > system ID > > (the default behaviour) and if that fails it can do something else. > > > >> Op 7-jul-2006, om 20:58 heeft Joseph Kesselman het volgende > >> geschreven: > >> > >>> A namespace name, although it is expressed as a URI, is just a > >>> name. Normal > >>> XML processing never never attempt to retrieve anything from it, so > >>> it is > >>> never processed by the EntityResolver. > >>> > >>> (The Semantic Web group may eventually define what, if anything, > >>> might be > >>> accessable through the namespace URI. But for now, treat it just > >>> as a > >>> string in URI syntax.) > >>> > >>> ______________________________________ > >>> "... Three things see no end: A loop with exit code done wrong, > >>> A semaphore untested, And the change that comes along. ..." > >>> -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish > >>> (http://www.ovff.org/pegasus/songs/threes-rev-11.html) > >>> > >>> > >>> -------------------------------------------------------------------- > >>> - > >>> To unsubscribe, e-mail: [EMAIL PROTECTED] > >>> For additional commands, e-mail: [EMAIL PROTECTED] > > > > Michael Glavassevich > > XML Parser Development > > IBM Toronto Lab > > E-mail: [EMAIL PROTECTED] > > E-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] [1] http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/EntityResolver.html#resolveEntity(java.lang.String,%20java.lang.String) [2] http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/ls/LSResourceResolver.html Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
