Hi,
I've got XML-files like the one attached. The interesting part is the DTD's system identifier, which links to an external DTD file. The following code fails with a 'Referent inaccessible' exception if the HTTP parcel is loaded, but no internet connection established. ((XMLParser on: '../test.xml' asFilename readStream) validate: false; scanDocument) root. Because the XML should not be validated, I do not expect the parser to actually trying to access the DTD file. If this is the specified behaviour, I wonder which is the best way to make an application work offline without modifying the above code which is part of the XML Object Marshaling framework? Have a nice weekend! Steffen _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc test.xml (207 bytes) Download Attachment |
Hi Steffen,
You'll want to change the entityResolver. There are several, but if you want to be totally offline and completely ignore the DTD, you can simply do: (XMLParser on: '..test.xml' asFilename readStream) validate: false; entityResolver: (XML.PluggableEntityResolver withBlock: [XML.ResolveEmptyResource]); scanDocument; root See the comment on PluggableEntityResolver for more details on what it can do. Cheers, Michael Steffen Märcker wrote: > Hi, > > I've got XML-files like the one attached. The interesting part is the > DTD's system identifier, which links to an external DTD file. The > following code fails with a 'Referent inaccessible' exception if the > HTTP parcel is loaded, but no internet connection established. > > ((XMLParser on: '../test.xml' asFilename readStream) > validate: false; > scanDocument) > root. > > Because the XML should not be validated, I do not expect the parser to > actually trying to access the DTD file. If this is the specified > behaviour, I wonder which is the best way to make an application work > offline without modifying the above code which is part of the XML > Object Marshaling framework? > > Have a nice weekend! > Steffen > ------------------------------------------------------------------------ > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Thank you,
I'll try it. The comment looks very promising in terms of plugable behaviour. Nice Sunday! Is it snowing across the pond too? Steffen Am 15.02.2009, 19:25 Uhr, schrieb Michael Lucas-Smith <[hidden email]>: > Hi Steffen, > > You'll want to change the entityResolver. There are several, but if you > want to be totally offline and completely ignore the DTD, you can simply > do: > > (XMLParser on: '..test.xml' asFilename readStream) > validate: false; > entityResolver: (XML.PluggableEntityResolver withBlock: > [XML.ResolveEmptyResource]); > scanDocument; > root > > See the comment on PluggableEntityResolver for more details on what it > can do. > > Cheers, > Michael > > Steffen Märcker wrote: >> Hi, >> >> I've got XML-files like the one attached. The interesting part is the >> DTD's system identifier, which links to an external DTD file. The >> following code fails with a 'Referent inaccessible' exception if the >> HTTP parcel is loaded, but no internet connection established. >> >> ((XMLParser on: '../test.xml' asFilename readStream) >> validate: false; >> scanDocument) >> root. >> >> Because the XML should not be validated, I do not expect the parser to >> actually trying to access the DTD file. If this is the specified >> behaviour, I wonder which is the best way to make an application work >> offline without modifying the above code which is part of the XML >> Object Marshaling framework? >> >> Have a nice weekend! >> Steffen >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> vwnc mailing list >> [hidden email] >> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |