xslt-2.0

Difference in template rule processing XSLT 1.0 vs 2.0

孤街醉人 提交于 2019-12-12 03:21:53
问题 Answering another XSLT question on this site, I stumbled on a difference between XSLT 1.0 and 2.0 that I don't understand. Who can explain what is happening here, and how the difference may be resolved? Note: I am using XML Spy version 2011 sp1 (x64). My input XML is <?xml version="1.0" encoding="UTF-8"?> <root> <Manager grade="10" id="26"> <Employee id="1" grade="9"/> <Employee id="2" grade="8"/> </Manager> <Manager grade="10" id="27"> <Employee id="3" grade="9"/> <Employee id="4" grade="8"/

How to store value in XSL and syntax for-each?

旧巷老猫 提交于 2019-12-12 03:15:13
问题 My request XML is : <?xml version="1.0" encoding="utf-8"?> <test123 class="test" version="str1234"> <Header> <MYD>str1234</MYID> </Header> <Body> <Action method="Request" type="PROV"> <Approval> <Approval1>1234567890</Approval1> <Linked123> <XYZNumber>12345</XYZNumber> </Linked123> <Version>123</Version> <Country level="12" hasModified="true" isSelected="true"> <Year>1999</Year> <Month>Jan</MonthShortName> </Country> <Version>123</Version> <Country level="12" hasModified="true" isSelected=

Layer 7 XSLT1.0 and XSLT2.0 compatibility

倾然丶 夕夏残阳落幕 提交于 2019-12-12 03:09:42
问题 We are using Layer7 which is an ESB featuring XML transformation with the help of XSLT1 and XSLT2. They use XALAN and Saxon 9.4.0.4 but they enable the FEATURE_SECURE_PROCESSING flag. For my tests I use a dedicated TransformerFactory class like this : package company.transformer.factory; import javax.xml.XMLConstants; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import net.sf.saxon

Creating multiple XML files & folders with XSLT

陌路散爱 提交于 2019-12-12 02:06:58
问题 I am trying to create an stylesheet to transform an XML to other format of an XML and in the process it should create multiple XML files that are placed in separate folders. The XML file I am trying to work with is very large(~50000 lines) and I want to automate it. So I don't have to hardcode every section. For example, if I have a simple XML like the following: <Site> <element run="test1"> <property name="aaa"/> <property name="bbb"/> <property name="ccc"/> <element run="test2"> <property

How to set the value of a variable in a udf requiring a path-call

喜欢而已 提交于 2019-12-12 02:04:17
问题 I'm trying to use a user-defined function in XSLT that repeatedly calls the value of a certain string. That string is based on the outcome of an XPath expression that doesn't change within the span of a single function call. I thought it would be a good idea to assign it to a variable rather than look it up over and over again. Unfortunately, at least in Saxon's implementation, you cannot use an XPath expression requiring a node inside a function, even one based on an absolute path, without

Xslt 2 convert non-unique elements to attributes for grid

让人想犯罪 __ 提交于 2019-12-12 01:54:47
问题 I have an XML file with this structure <levels> <level id="0" qd="NE"> <gate>99</gate> <zone>2</zone> <laydown>4</laydown> </level> <level id="0" qd="SE"> <gate>1</gate> <zone>6</zone> <laydown>1</laydown> <laydown>2</laydown> <laydown>3</laydown> <zone>5</zone> <zone>5</zone> </level> </levels> And I need to convert it to something like this to display in a grid <level id="0" qd="NE" gate="99" zone="2" laydown="3"> <level id="0" qd="NE" gate="1" zone="5,6" laydown="1,2,3"> I have found xslt

matching the following and call template

随声附和 提交于 2019-12-12 01:45:50
问题 This is a simplified XML which exposes the general structure of the problem I have. <chapter num="07"> <title> <page num="703"/> ... text (mixed content) ... </title> <page num="704"/> <section level="sect1"> <title>...text...</title> <para num="7.1.1">... a lot of text (mixed content)...</para> </section> <section level="sect1"> <title>... text... </title> <para num="7.2.1">Some text... <footnoteref linkend="fn3" num="3"/> <footnote num="3" id="fn3"> ... mixed content ...</footnote> ...more

extract value from an array in xslt

随声附和 提交于 2019-12-12 01:22:44
问题 I have variable 'temperatureQualifier' whose type is array. I need to read that array variable and extract each value from the array and use it in my XSLT. Sample Input XML is <document> <item> <gtin>1000909090</gtin> <flex> <attrGroupMany name="tradeItemTemperatureInformation"> <row> <attr name="temperatureQualifier">[10, 20, 30, 40]</attr> </row> </attrGroupMany> </flex> </item> </document> Desired Output XML should be <?xml version="1.0" encoding="UTF-8"?> <CatalogItem> <RelationshipData>

XSLT to modify attribute value and add new element

会有一股神秘感。 提交于 2019-12-12 01:15:41
问题 I have below XML <?xml version="1.0" encoding="UTF-8"?> <Wrapper> <DynamicEnrichment> <outpath>/opt/oracle/archive</outpath> </DynamicEnrichment> <ImagedDocuments sequence="11" beginTime="2018-12-03T16:03:11.7237883-06:00" endTime="2018-12-03T16:03:11.7237883-06:00"> <Document type="Secure - New Business Reg 60 Disclosure Form" path="\\prdausrvs01\Transfer\Onbase\OUT\EnterprisePrint\b726e5d73692463da29bd9183d6c3b6e_AV001220207.TIF" fileName="REG60DISC"/> <Document type="Secure - New Business

Use XSLT to convert delimited text to XML

折月煮酒 提交于 2019-12-12 01:05:40
问题 I have some double pipe delimited data inside some XML tags and I would like to replace/convert the delimited text to XML. The delimited text also uses a colon to separate the heading and the data, like so: ||tagname:data|| The headings or tag names could be anything, this is just one example. So I don't know in advance what I'm getting. I must take what's listed in front of the colon and use that. <doc> <arr name="content"> <str> stream_source_info docname stream_content_type text/html