xalan

Java/XSLT: Cannot find a matching 1-argument function

旧城冷巷雨未停 提交于 2019-12-01 17:26:11
I get the following error: javax.servlet.ServletException: Cannot find a matching 1-argument function named {http://exslt.org/dynamic}evaluate() at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) The top of my xslt file is <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dyn="http://exslt.org/dynamic" extension-element-prefixes="dyn"> Do you know why I may be getting this error? UPDATE The

Is dyn:evaluate extension function known to have issues in Xalan-J 2.7.1?

半腔热情 提交于 2019-12-01 11:42:06
I'm stumped as to why the following example program refuses to apply my stylesheet properly. It seems that dyn:evaluate in Xalan 2.7.1 is refusing to process certain XPath variables. Running the following program with xalan-j in classpath yields the following results: package com.testing2.xslt; import java.io.*; import java.util.logging.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class DynEvaluateTransform { private static final String XSLT = "" + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\

Is dyn:evaluate extension function known to have issues in Xalan-J 2.7.1?

孤街醉人 提交于 2019-12-01 11:10:35
问题 I'm stumped as to why the following example program refuses to apply my stylesheet properly. It seems that dyn:evaluate in Xalan 2.7.1 is refusing to process certain XPath variables. Running the following program with xalan-j in classpath yields the following results: package com.testing2.xslt; import java.io.*; import java.util.logging.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class DynEvaluateTransform { private static final String XSLT = "" + "<?xml

Splitting XML file into multiple at given tags

亡梦爱人 提交于 2019-12-01 07:28:34
问题 I want to split a XML file into multiple files. My workstation is very limited to Eclipse Mars with Xalan 2.7.1. I can also use Python, but never used it before. <?xml version="1.0" encoding="UTF-8"?> <root> <row> <NAME>Doe</NAME> <FIRSTNAME>Jon</FIRSTNAME> <GENDER>M</GENDER> </row> <row> <NAME>Mustermann</NAME> <FIRSTNAME>Max</FIRSTNAME> <GENDER>M</GENDER> </row> </root> How can I transform them to look like this <?xml version="1.0" encoding="UTF-8"?> <root> <row> <NAME>Doe</NAME> <FIRSTNAME

java.lang.NoClassDefFoundError: org/apache/xpath/XPathAPI

亡梦爱人 提交于 2019-12-01 07:17:14
I am executing a class in eclipse through main, and as I result I am getting this error java.lang.NoClassDefFoundError: org/apache/xpath/XPathAPI I am using jRE6. Please help me in solving this Make sure you have xalan-2.7.1.jar on your build path. http://mirrors.ibiblio.org/pub/mirrors/maven2/xalan/xalan/2.7.1/xalan-2.7.1.jar You must add the apache xpath library to your class path. 来源: https://stackoverflow.com/questions/13602167/java-lang-noclassdeffounderror-org-apache-xpath-xpathapi

java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

旧时模样 提交于 2019-12-01 04:02:41
问题 In the following code: private Document transformDoc(Source source) throws TransformerException, IOException { TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(new StreamSource(xsltResource.getInputStream())); JDOMResult result = new JDOMResult(); transformer.transform(source, result); return result.getDocument(); } I get this exception: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR

TransformerFactory and Xalan Dependency Conflict

白昼怎懂夜的黑 提交于 2019-11-30 19:41:13
问题 I have the following code: javax.xml.transform.TransformerFactory factory = TransformerFactory.newInstance(); factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); javax.xml.transform.Transformer transformer = factory.newTransformer(); This works fine normally. However, I also need to add Xalan as a dependency in my pom.xml, and when I do, the above code now throws an error: java.lang.IllegalArgumentException: Not supported: http://javax.xml.XMLConstants/property/accessExternalDTD I

How to use a parameter in a xslt as a XPath?

你离开我真会死。 提交于 2019-11-30 17:52:55
I'd like to add an element to a xml document and I'd like to pass as a parameter the path to the element. sample.xml file: <?xml version="1.0"?> <stuff> <element1> <foo>2</foo> <bar/> </element1> <element2> <subelement/> <bar/> </element2> <element1> <foo/> <bar/> </element1> </stuff> Using: xalan.exe -p myparam "element1" sample.xml addelement.xslt I'd like the following result: <?xml version="1.0"?> <stuff> <element1> <foo>2</foo> <bar/> <addedElement/> </element1> <element2> <subelement/> <bar/> </element2> <element1> <foo/> <bar/> <addedElement/> </element1> </stuff> I've manage to write

NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces

主宰稳场 提交于 2019-11-30 11:14:26
Trying to retrieve the SOAP body from a SOAP response, but getting this error: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. Document doc = soapResMsg.getSOAPBody().extractContentAsDocument(); -- Exception is thrown here org.dom4j.io.DOMReader d4Reader = new org.dom4j.io.DOMReader(); org.dom4j.Document d4doc = d4Reader.read(doc); Using Saaj1.4 What would be a fix for this? I faced the same problem. In my case, fix the problem on server side was not an option. I fixed it on client side forcing Xalan to version 2.7.0. See

How do I make xsl transformation indent the output?

北城以北 提交于 2019-11-29 09:32:14
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? For indentation you need to use a different namespace: " http://xml.apache.org/xslt " (see this issue ) <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:redirect="http://xml.apache.org