ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Lochart <dloch...@capecomputing.com>
Subject Ant, Xerces-2.6.2, and XInclude -- HELP
Date Tue, 21 Sep 2004 22:04:50 GMT
All,

I have written a custom Task that loads an xml document, runs it through 
a jaxb like system to load java objects and then pass the root object on 
to Velocity for template transformations.  The xml documents are 
describing web pages and I wanted the ability for the xml docs to 
include common xml sections (like navigation sections) using XInclude.  
I have a standalone java app that will load the xml doc and dumps the 
result out and you can see that the XInclude worked.  I have placed the 
proper xercesImpl and xml-apis in $ANT_HOME/lib and when I try to run my 
task the xml parsing portion fails to execute the XInclude semantics.  I 
strongly believe that its the configuration that is causing the 
problem.  In order to get XInclude to work you have to change the parser 
configuration and the recomended way to do that is to set a system 
property like such:

-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=xerces.parsers.XIncludeParserConfiguration

In my custom task I did a System.getProperty() on 
"org.apache.xerces.xni.parser.XMLParserConfiguration" and discovered 
that it was not there.  It appears as though when ant sets up the 
project it makes the system properties available to the project but 
seems to remove them from the environment.  Are my assumptions correct?

The only other way to change the configuration is JRE wide by creating a 
xerces.properties file in the JRE/lib directory.  I don't want a system 
wide change and should not have to do that.  I feel the answer to my 
dilemna is an easy one but one that escapes me.

Thanks in advance!

Doug Lochart
Ace Technologies Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message