This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm upgrading an application that currently uses Xalan 2.6 to Xalan 2.7.1. I ran into an issue and I'm trying to confirm if this was a change in behavior and what I can do about it.
The XML file being transformed let's say is named "/a/b/c/Main.xml" and includes the following in its content: <include xmlns="http://www.w3.org/2001/XInclude" href="chapter_c35.xml" />
With 2.6, the transformation of the XML file completes w/o errors or exceptions but the content of chapter_c35.xml is not included. I assume chapter_c35.xml is not found. The XML content is actually in-memory and using breakpoints, I confirmed there was no attempt to access this content.
With 2.7.1, the transformation of the XML file fails throwing the exception org.apache.xalan.xsltc.TransletException: org.apache.xml.utils.WrappedRuntimeException: C:\a\b\c\chapter_c35.xml (The system cannot find the path specified)
QUESTIONS: Is this a known change from 2.6 to 2.7.1? Was 2.6 incorrectly not failing when it can not resolve an include? Or did something change in the way includes are resolved (e.g., what gets called)?
Now, as for why the content of chapter_c35.xml is not found...I'm trying to confirm if this is really a bug in the application or if it is expected for this particular case (e.g., only want styled snippet of XML) but in the meantime, the TransformerFactory and Transformer objects do not have a URI resolvers set but the Source object that represents the XML content has a URI resolver set. Using breakpoints, I confirmed this is not called (for either 2.6 or 2.7.1).
QUESTIONS: Is there any particular reason why the Source URI resolver would not be called? Our URI resolver is a class that is a function of the source itself (i.e., each Source has its own resolver to account for differences). Good or bad, I'm not sure if a shared URI resolver set at the TransformerFactory or Transformer level would work w/o non-trivial changes.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com