xalan

How do I make xsl transformation indent the output?

ぐ巨炮叔叔 提交于 2019-11-28 02:57:42
问题 I'm using xalan with the following xsl header: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:redirect="http://xml.apache.org/xalan/redirect" extension-element-prefixes="redirect" xmlns:xalan="http://xml.apache.org/xalan"> <xsl:output method="text" indent="yes" xalan:indent-amount="4"/> And the output is not indented. Anyone with ideas? 回答1: For indentation you need to use a different namespace: "http://xml.apache.org/xslt" (see this issue) <xsl

Default support for xinclude in Java 6?

家住魔仙堡 提交于 2019-11-27 22:27:35
I see in my application that xinclude inside my parsed XML file does not work within my Java XSLT conversion. However, although I do: DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setXIncludeAware(true); I'm not specifically setting the transformer factory as System.getProperty("javax.xml.transform.TransformerFactory") returns "null". My question: does the default Java (1.6 or 6) support xinclude or do I have to add an alternative XSLT parser such as Apache Xerces? According to the spec , support has been there since Java 1.5 (5). I believe XInclude support

Using Xalan alongside Saxon

十年热恋 提交于 2019-11-27 18:23:41
问题 I use Xalan in my application, but need to use Saxon with a reference implementation to generate test output to compare with. I want to use them both during unit tests. However, as soon as I add an dependency on Saxon in the project .pom, the application seems to use Saxon for all xslt and XPath operations during tests: <dependency> <groupId>net.sf.saxon</groupId> <artifactId>Saxon-HE</artifactId> <version>9.4</version> <scope>test</scope> </dependency> This makes the main application fail