Hello Peter,

thank you for your help (so far). I have seen in the Xalan java code
that there is no option to give him "passthrough" parameters for the XML
parser (Xerces in this case). I think it could be useful for the users -
what do you think?

Another problem I have struggled with was that with java 1.4.x a xalan
version was included in the java runtime. I have seen that I have to put
the new version into the endorsed dir or give the option
java.endorsed.dirs on commandline. With the new xalan version in place I
had some difference in the EXSLT usage and namespace behaviour. This is
now fixed - it was a failure in my XSL files.

I have made a test with some java code to call Xalan-J. Here is my code
snippet:

        
System.setProperty("javax.xml.parsers.DocumentBuilderFactory","org.apach
e.xerces.jaxp.DocumentBuilderFactoryImpl");
        
System.setProperty("javax.xml.parsers.SAXParserFactory","org.apache.xerc
es.jaxp.SAXParserFactoryImpl");
        
System.setProperty("org.apache.xerces.xni.parser.XMLParserConfiguration"
,"org.apache.xerces.parsers.XIncludeParserConfiguration");
        DocumentBuilderFactory dbfactory =
DocumentBuilderFactory.newInstance();
        dbfactory.setNamespaceAware(true);
        //dbfactory.setXIncludeAware(true);
        
//dbfactory.setFeature("http://apache.org/xml/features/xinclude";, true);
        
dbfactory.setFeature("http://apache.org/xml/features/xinclude/fixup-base
-uris", false);
        
//dbfactory.setFeature("http://apache.org/xml/features/xinclude/fixup-la
nguage", false);
        DocumentBuilder parser = dbfactory.newDocumentBuilder();
        Document document = parser.parse(new File("input.xml"));
        DOMSource xmlSource = new DOMSource(document);
        TransformerFactory tFactory = TransformerFactory.newInstance();
        Transformer transformer = tFactory.newTransformer(new
StreamSource("index.xsl"));
        transformer.transform(xmlSource, new StreamResult(new
FileOutputStream("output.xml")));

This code transforms the xml with the xsl file but does not recognize
the fixup-base-uris option set. I get the xml:base attributes in the
output file. What is wrong with this code?

Is there any basic tutorial or wiki how to use xalan and xerces from
java code?

Regards
Oliver Paulus

-----Original Message-----
From: Peter McCracken [mailto:[EMAIL PROTECTED] 
Sent: Mittwoch, 15. Februar 2006 22:14
To: general@xml.apache.org
Subject: RE: Xalan-J, Xerces-J XInclude question

"Paulus Oliver" <[EMAIL PROTECTED]> wrote on 02/14/2006 11:03:39

AM:

> Is there a possibility to set this feature in the commandline mode? I
do
> not use any java code (until now). My current call looks like this:
> 
> java -jar
>
-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.
> parsers.XIncludeParserConfiguration
> parser\xalan-j_2_7_0-bin\xalan-j_2_7_0\xalan.jar -IN
source\source1.xml
> -XSL xsl\main.xsl -OUT target\result.xml 

Hi Oliver,

Unfortunately, there's no way to pass feature values to the XML parser 
using the command line of Xalan's Process program.  I think you'll need
to 
write a small Java program to get the functionality you want.

-- 
Peter McCracken
XML Parser Development
IBM Toronto Lab
Email: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to