Ok, that makes sense. And good news with the future inclusion of the XMLEntityResolver.

In the mean time, I got my custom entity resolver working when I use the path to the XML file in the transform call (before I wasn't setting the system IDs correctly in the InputSources, which was causing the working directory to be passed in to the entity resolver). However, when I try to use a Xerces DOM as the XML input, it doesn't seem to use the system id that the DOM has, or the system id that I set in the XercesDOMWrapperParsedSource, and ends up using the working directory. Is there another way to set the system id for the XML when using a Xerces DOM as the source?

Kelly

David Bertoni wrote:
Kelly Graus wrote:
Thanks for the reply. How can it possibly know the fully resolved system id if I don't tell it where the xml came from? It looks like all it does is assume that it's in the current working directory.


Any URIs for external entities are resolved relative to the containing entity. If Xerces-C is providing a system ID that is resolves to the current working directory, it's because the system ID of the containing entity is a file URI.

Is there any way to get the base URI? Looking through the mailing list archives, it doesn't seem like anyone knows how, if there is a way. Are there any plans to make use of something like the Xerces XMLEntityResolver?

Yes, we have an open defect to add support for XMLEntityResolver, and it will hopefully be in the next version of Xalan-C. However, you can also set the system ID of the base InputSource to whatever you want it to be, as long as the parser doesn't need that system ID to locate the entity.

Dave

Reply via email to