aspose file tools
The moose likes XML and Related Technologies and the fly likes xalan include href not resolved Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xalan include href not resolved" Watch "xalan include href not resolved" New topic

xalan include href not resolved

Kelly Dolan
Ranch Hand

Joined: Jan 08, 2002
Posts: 109
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="" 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)
at org.apache.xalan.xsltc.dom.LoadDocument.documentF(

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.

wood burning stoves
subject: xalan include href not resolved