xslt

XSLT fails to transform DITA into new type

若如初见. 提交于 2020-04-30 10:32:36
问题 I have an xml as following: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE concept SYSTEM "aimlDomain.dtd"> <?xml-stylesheet type="text/xsl" href="aimlTest.xsl"?> <concept> <category> <pattern>_ TOPIC ELEMENT ATTRIBUTE</pattern> <template><srai>REQUIRED TOPIC AND MAP ELEMENT ATTRIBUTES</srai> </template> </category> <category> <pattern>TOPIC ELEMENT ATTRIBUTE _</pattern> <template><srai>REQUIRED TOPIC AND MAP ELEMENT ATTRIBUTES</srai> </template> </category> </concept> The element category

How to return document node from Saxon's extension function?

僤鯓⒐⒋嵵緔 提交于 2020-04-30 08:46:46
问题 I'm looking at Integrated extension functions in Saxon-HE 10 (Java). I need the function to return a document-node()? which is constructed from StreamSource . Answer to a similar question mentions this code: context.getConfiguration().buildDocument() However context is not passed to ExtensionFunction , only XdmValue[] arguments . ExtensionFunctionDefinition does accept XPathContext context , but it looks like getConfiguration().buildDocument() is not present in 10. Instead, there is context

XSLT Help - Create a varibale in XSLT to store cross reference mapping and group input elements based on that mapping

微笑、不失礼 提交于 2020-04-30 06:27:47
问题 I have a payroll XML file that contains a child element(pay_component_code) for every line item row. I'm provided with a mapping document that contains translation between current codes and future codes, either 1:1 or M:1. The requirement is to convert the xml to pipe delimited text file and also aggregate the amount based on a grouping of person number, effective date and pay component code (future state). The xslt I have seems to work fine for a sample population but however, when I ran the

Create XML based on 2 XMLs and looking up values in both files using XSLT2.0

穿精又带淫゛_ 提交于 2020-04-30 06:24:49
问题 I am trying to generate a XML based on 2 other XMLs. I am polling a DB that returns details of people(There can be n number of people returned in query). The final XML should have the exact number of Data tags as the distinct name tags in the XML coming from DB . For Ex: 1st XML- Getting this from DB <parent> <child> <name>John</name> <city>Boston</city> </child> <child> <name>John</name> <city>Seattle</city> </child> <child> <name>Allison</name> <city>Houston</city> </child> </parent> 2nd

实验:关于XPath中的13个轴

混江龙づ霸主 提交于 2020-04-26 06:35:31
XSLT使用XPath来找寻XML文档中的信息,这几天在学习XSLT的找寻路径过程中,我写了下面这个例子,来加深我对XPath中各个轴的概念的理解 测试用的XML文档和XSLT文档 XML文档:LogReport.xml <?xml version="1.0" encoding="gb2312"?> <?xml-stylesheet type='text/xsl' href='LogReport.xslt'?> <LogReport CreateTime="2015/2/7 20:34:17"> <Data>DataA</Data> <Data>DataB</Data> <Data>DataC</Data> <LogList ListName="XXX"> <Log LogLevel="0" LogItem="Zhang" Description="Log1"> <LogMessage Message="abcdefg" /> </Log> <Log LogLevel="0" LogItem="Wang" Description="Log2"> <LogMessage Message="hijklmn" /> </Log> <Log LogLevel="1" LogItem="Lee" Description="Log3"> <LogMessage Message="opqrst"

XSLT transformation to read xml element and value and convert xml data into name value pair

房东的猫 提交于 2020-04-18 05:35:52
问题 Need below help to adjust the xslt so that if there is repeating multioccurance node example "SalesQuoteParty" then : Only Produce output name value pair if SalesQuoteParty-RoleCode = 39 or 1001 (Need help how to filter party data based on Role Code) Concatenate the value of element RoleCodeText to the name, for example, current output - SalesQuoteCollection.SalesQuote.SalesQuoteParty.SalesQuoteParty.RoleCodeText becomes - Owner.SalesQuoteCollection.SalesQuote.SalesQuoteParty.SalesQuoteParty

Alternative XSLT processor to Apache Xalan

半世苍凉 提交于 2020-04-18 02:56:44
问题 I am currently using the Apache Xalan XSLT processor in my Java application, but I would like to use some alternative solution which supports use of extension functions. Xalan seems to be out of date and buggy. I know of Saxonixa Saxon, but it is closed sourced. Is there some open source and well working alternative? 回答1: The current open source version of Saxon, Saxon-HE 9.9, supports "integrated extension functions" (functions written to a particular Saxon-defined Java interface). It doesn

Alternative XSLT processor to Apache Xalan

邮差的信 提交于 2020-04-18 02:55:28
问题 I am currently using the Apache Xalan XSLT processor in my Java application, but I would like to use some alternative solution which supports use of extension functions. Xalan seems to be out of date and buggy. I know of Saxonixa Saxon, but it is closed sourced. Is there some open source and well working alternative? 回答1: The current open source version of Saxon, Saxon-HE 9.9, supports "integrated extension functions" (functions written to a particular Saxon-defined Java interface). It doesn

Alternative XSLT processor to Apache Xalan

☆樱花仙子☆ 提交于 2020-04-18 02:53:07
问题 I am currently using the Apache Xalan XSLT processor in my Java application, but I would like to use some alternative solution which supports use of extension functions. Xalan seems to be out of date and buggy. I know of Saxonixa Saxon, but it is closed sourced. Is there some open source and well working alternative? 回答1: The current open source version of Saxon, Saxon-HE 9.9, supports "integrated extension functions" (functions written to a particular Saxon-defined Java interface). It doesn

undefined: undefined error when calling XSLTProcessor.prototype.importStylesheet

做~自己de王妃 提交于 2020-04-16 03:28:28
问题 I want to prettify some XML, and I found following code (in this answer, JSFiddle). I modified it like this: const xsltDoc = new DOMParser().parseFromString([ // describes how we want to modify the XML - indent everything '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">', ' <xsl:output omit-xml-declaration="yes" indent="yes"/>', ' <xsl:template match="node()|@*">', ' <xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy>', ' </xsl:template>', '</xsl:stylesheet>', ]