Hi All,
 
I think there is something missing in the DTMManagerDefault implementation.
It should be possible to specify an EntityResolver for a certain Transformer (transformation).
Currently this is not possible. (Unfortunately)
 
Think about this:
 
You have 2 XML files. Both have a DTD (http://)....
You have one style sheet that shall merge both XML files.
To do this you apply the style sheet on the first XML file.
The second XML file gets opend by the document function in the style sheet.
 
Problems:
 
If you are working offline you get exceptions for the first and the second XML file.
The http.... url (DTD) can't be found in both cases. If you work online, everything is fine.
 
Workaround:
 
If you pre-parse the first XML file to a DOMSource you can pass this source to
the Transformer. That is fine, and you won't get an "Unknown host exception",
because you can set an EntityResolver for the parser that is used to get the DOMSource.
 
But the problem with the second XML file stays. You can't use the same trick, because you don't
know which file to open during the development of the application. The style sheet knows
this only. And there are different files to be opend and all of them have different DTDs.
 
The only way out is to pass an EntityResolver to the Transformer, so that your DTMManagerDefault uses
this one in the getDTM method. This one is missing.
 
Questions:
 
Am I right?
Are there any plans to get something like this in soon?
Has anybody an idea what I can do in the meantime?
If I am going to change the code, what do I have to do?
 
Cheers Marc.
 
 

Reply via email to