saxon

XSLT copy element from one xml to other xml if some element matches

删除回忆录丶 提交于 2019-12-13 09:53:34
问题 I have following xml's: notifications-source-path.xml <?xml version="1.0" encoding="UTF-8"?> <Notifications> <Notification> <NotifId>1</NotifId> <MsgText> <![CDATA[notif 1]]> </MsgText> </Notification> <Notification> <NotifId>2</NotifId> <MsgText> <![CDATA[notif 2]]> </MsgText> </Notification> </Notifications> and notifications.xml <?xml version="1.0" encoding="UTF-8"?> <Notifications> <BatchId>1123213333</BatchId> <Notification> <NotifId>1</NotifId> <EmailNotification> <SenderAddress>abc@def

How can I find all elements in an XML Schema whose value is specified as a QName?

主宰稳场 提交于 2019-12-13 07:36:05
问题 Suppose that... I have a complex XML schema, one that imports/includes other schema files, which in turn import/include even more schema files. I want to find all the elements in this XML schema that have a value (i.e., text node) that is declared to be of type QName. I want the location (path) of these elements to be expressed as XPath statements (e.g., /foo/bar). If I'm writing a Java application, what's the right technology for this job? Is it a schema object model like XSOM? Is it the

Does Saxon 9 supports java varargs in extension functions?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 05:02:03
问题 Can Saxon map the following extension function call the java static method with varargs below? XSLT: <xsl:value-of select="mylib:fun('a', 'b', 'c')"/> Java public static String fun(String arg1, String... args) { ... } I would expect that saxon supports varargs but, I get The namespace URI and local name are recognized, but the number of arguments is wrong Am I doing something wrong? It seems it's able to recognize a sequence () but I want to implement a function with zero or more arguments

Keep CDATA for xstl transformation?

怎甘沉沦 提交于 2019-12-13 04:16:56
问题 I'm doing a xstl transformation with saxon from an XML document. The doc is not standard-valid XML, and I want to preserve all <![CDATA[< elements that are found in there. However using the .xsl file for transformation with Transformer trans = TransformerFactory.newInstance().newTransformer(new StreamSource(new File("foo.xsl")); trans.transform(new StreamSource(new File("foo.xml"), new StreamResult(new File("output.xml"))); results in stripping out these CDATA entries. How can I prevent this?

JSON to XML with XSLT 3.0 using saxon

青春壹個敷衍的年華 提交于 2019-12-13 03:36:15
问题 I'm using XSLT 3.0 to transform this document JSON to this document XML with the function json-to-xml, <xsl:variable name="input-as-xml" select="json-to-xml(.)"/> From saxon I pass this json like document XML: String XML = "<root>" + JSON + "</root>"; I get an XML when call the function json-to-xml: <?xml version="1.0" encoding="utf-8"?> <map xmlns="http://www.w3.org/2005/xpath-functions"> <string key="_D">urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</string> <string key="_S">urn

Remove space in between doctype in XML using XSLT

房东的猫 提交于 2019-12-13 03:17:04
问题 While transforming XML to XML using XSLT I have included doctype in output XML. But a line break is created in the output XML doctype declaration. XSLT: <xsl:output method="xml" doctype-system="book3.dtd" doctype-public="-//Atypon//DTD test//EN" version="1.0" encoding="UTF-8" indent="no"/> output XML after using XSLT: <!DOCTYPE book PUBLIC "-//Atypon//DTD test//EN" "book3.dtd"> Space and line break are created in between book and public in doctype declaration. I need the doctype declaration

Saxon dont find the “jni.h” File

别说谁变了你拦得住时间么 提交于 2019-12-13 03:11:20
问题 Im setting up Saxon/C extension on Ubuntu Installing Java Set the System Environment Variable /usr/local/Saxonica/Saxon-HEC1.1.0/Saxon.C.API/SaxonProcessor.h:10:10: fatal error: jni.h: Datei oder Verzeichnis nicht gefunden #include After i executed the "make" command, this error crop up 回答1: In Saxon/C 1.1.0 the jni header files have to be downloaded separately. Usually they are in the java install. However, if you download the latest version of Saxon/C 1.1.2 the jni headers are in the

XSLT transform without input XML with saxon parse

徘徊边缘 提交于 2019-12-13 02:27:58
问题 Original question was here, now case slightly modified with saxon. I have following xsl tranformation: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/"> <xsl:output method="xml" indent="yes" /> <xsl:param name="products"> <products author="Jesper"> <product id="p1"> <name>Delta</name> <price>800</price> <stock>4</stock> <country>Denmark</country> </product> <product id="p2"> <name>Golf<

XML - XSLT - Using two XML files - Additions to XML file consulting another XML file

最后都变了- 提交于 2019-12-13 00:22:48
问题 I have the following problem that, for me, is kind of tricky, Basically I need to be able to modify a XML input file with data that I have stored in another XML file, so I would have to use 2 input XML files, I have the following XML file, which is the one I want to modify (basically, just make additions to it): <?xml version="1.0" encoding="UTF-8"?> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1"> <text-prop name="displayName">PersonTemplate</text-prop> <setup

error when calling exslt in Saxon

对着背影说爱祢 提交于 2019-12-13 00:09:28
问题 I get the error message: "Cannot find a matching 1-argument function named {http://exslt.org/common}node-set()" when running a xslt transformation with the Saxon engine. I've tried using Saxon PE and EE on Windows XP and it gives the same error. EXSLT should work out of the box with Saxon. Does anyone have a solution on how I may resolve this, please? 回答1: Saxon PE and EE are XSLT 2.0 processor implementations where you don't need a node-set extension function as in XSLT 2.0 the difference