xalan

Cannot get Xalan to run any example

旧巷老猫 提交于 2019-12-11 13:13:38
问题 I downloaded Xalan-Java Version 2.7.1 , unpack it, and then set the PATH for java and CLASSPATH for xalan: set path=%PATH%;c:\Program Files\Java\jre6\bin set classpath=%CLASSPATH%;c:\Xalan\ (I also tried setting the classpath only for xalan.jar, xercesImpl.jar, xml-apis.jar) When testing a simple Hello World example (or any other example): java org.apache.xalan.xslt.Process -in hello.xml -xsl hello.xsl -out hello.html I always get this: Exception in thread "main" java.lang

How to do this in XSLT without incrementing variables? (Tweaking Xalan to create a global XSLT iterator. Do I have other options?)

China☆狼群 提交于 2019-12-11 10:30:58
问题 I'm trying to think functional, in XSLT terms, as much as possible, but in this case, I really don't see how to do it without tweaking. I have roughly this data structure: <transactions> <trx> <text>abc</text> <text>def</text> <detail> <text>xxx</text> <text>yyy</text> <text>zzz</text> </detail> </trx> </transactions> Which I roughly want to flatten into this form <row>abc</row> <row>def</row> <row>xxx</row> <row>yyy</row> <row>zzz</row> But the tricky thing is: I want to create chunks of 40

A way to split a huge XML file into smaller xml files with XSL

倾然丶 夕夏残阳落幕 提交于 2019-12-11 07:08:09
问题 I get a huge XML file containing a list of TV broadcasts. And I have to split it up into small files containing all broadcasts for one day only. I managed to to that but have two problems with the xml header and a node being there multiple times. The structure of the XML is the following: <?xml version="1.0" encoding="UTF-8"?> <broadcasts> <broadcast> <id>4637445812</id> <week>39</week> <date>2009-09-22</date> <time>21:45:00:00</time> ... (some more) </broadcast> ... (long list of broadcast

TransformerFactory.newInstance().newTransformer(streamSource) returns null

♀尐吖头ヾ 提交于 2019-12-11 07:00:58
问题 How could that be that TransformerFactory.newInstance().newTransformer(streamSource) returns null. According to javadoc this is not possible: http://download.oracle.com/javase/6/docs/api/javax/xml/transform/TransformerFactory.html#newTransformer(javax.xml.transform.Source) here's groovy code sample def is = new ClassPathResource('xslt/MySpace-Contact.xsl').inputStream println is def streamSource = new StreamSource(is) println streamSource def factory = TransformerFactory.newInstance() println

In Xalan XSLT 1.0, how to pass a variable to a template match?

僤鯓⒐⒋嵵緔 提交于 2019-12-11 05:29:30
问题 We are using Xalan XSLT 1.0 in Java and we want to pass a variable to a template match to avoid hard-coding element names in the XSL file. The style sheet compiles, but the date returned is wrong. Are we using the correct syntax? Possible XML inputs... <books> <book/> <book/> </books> <dvds> <dvd/> <dvd/> </dvds> <xsl:variable name="matchElement" select="'book'"/> <!-- OR --> <xsl:variable name="matchElement" select="'dvd'"/> <xsl:template match="/*[local-name() = $matchElement]"> 回答1: This

TransformerConfigurationException: Cannot set the feature for Transformer

我只是一个虾纸丫 提交于 2019-12-11 04:29:25
问题 i'm getting below error while setting the feature for TransformerFactory. javax.xml.transform.TransformerConfigurationException: Cannot set the feature 'http://apache.org/xml/features/disallow-doctype-decl' on this TransformerFactory. at org.apache.xalan.processor.TransformerFactoryImpl.setFeature(TransformerFactoryImpl.java:416) Code snippet is:: public static TransformerFactory mytFactory; mytFactory = TransformerFactory.newInstance(); mytFactory.setFeature(“http://apache.org/xml/features

how can I tell xalan NOT to validate XML retrieved using the “document” function?

别说谁变了你拦得住时间么 提交于 2019-12-09 17:58:48
问题 Yesterday Oracle decided to take down java.sun.com for a while. This screwed things up for me because xalan tried to validate some XML but couldn't retrieve the properties.dtd. I'm using xalan 2.7.1 to run some XSL transforms, and I don't want it to validate anything. so tried loading up the XSL like this: SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setValidating(false); XMLReader rdr = spf.newSAXParser().getXMLReader(); Source xsl = new SAXSource

using xml as xsl variable

牧云@^-^@ 提交于 2019-12-08 13:50:46
问题 I have to create slightly dynamic pdf (two variables) with two text blocks in different languages. Most of the text in both blocks is static I was thinking if I could create one template that would create xsl-fo for the layout. Then create two variables containing custom xml. Something like: <xsl:variable name="TEXT_CONTENT_ENG" > <STATIC_TEXT> <LABEL>Hello</LABEL> <REQUEST>Please pay your bill before </REQUEST> </STATIC_TEXT> </xsl:variable> Finally I could apply created template twice using

Transform XML to XML using XSLT based on XSD

前提是你 提交于 2019-12-08 08:09:58
问题 I am using XSLT/Xalan to transform one XML file into another. In doing so, I found that when I was creating my XSLT stylesheet, I was hardcoding the nodes of the target file I wanted generated. This just seemed odd. Is there anyway to programmatically generate the target file using the XSD? I want to basically create the skeleton of the file using the XSD I have and then run my stylesheet against the source file. Then, I can plunk the values I find from there into the appropriate spots in the

XSLT Xalan dyn:evaluate example

我们两清 提交于 2019-12-08 02:41:47
问题 I want yo use the EXSLT - DYN:EVALUATE in a style sheet. I have added the names pace but I don't know where the .xsl file I need to import is. I don't believe I have XALAN installed to point the import to. How would I install this? Once installed and I point it to the .xsl will it pick up the function and apply it? I am running Windows. The XSLT file is included at the top of the XML document. Thanks Pete 回答1: Xalan has the EXSL dyn:evaluate function built-in, you don't need to import