[vwnc] XMLParser - Referent inaccessible

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] XMLParser - Referent inaccessible

Steffen Märcker
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
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] XMLParser - Referent inaccessible

Michael Lucas-Smith-2
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
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] XMLParser - Referent inaccessible

Steffen Märcker
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