xslt-2.0

Dynamic doctype in XSLT transform (correct use of result-document instruction)

柔情痞子 提交于 2019-12-14 04:18:44
问题 I'm using XSLT and need to generate the doctype dynamically in the transformed output, based on a parameter. I hear that this cann't be done using XSLT 1.0, but can with version 2.0, using the result-document tag. So far, from following the answer in this question, I have something like this: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="html" indent="yes"/> <xsl:param name="doctype.system" select="'http://www.w3.org/TR/xhtml1/DTD/xhtml1

When will xslt 2.0 be finished

久未见 提交于 2019-12-14 03:46:50
问题 I really want to start developing in xslt 2.0 but I have been hearing that xslt 2.0 is not supported in browsers yet. Is there an expected date that xslt 2.0 will be done and when will it be supported in browsers? 回答1: XSLT 2.0 is already finished: W3C recommendation But it seems like support is rather lacking. Wikipedia says: XSLT is developed by the World Wide Web Consortium (W3C). The most recent version is XSLT 2.0[4], which reached W3C recommendation status on 23 January 2007. As of 2010

creating a tree structure from a delimited string xslt 2.0

寵の児 提交于 2019-12-14 03:36:23
问题 I have a input string looks like below test1->test2->test3 I want to build a tree structure like the below. -test1 +test2 How can I convert the string to tree structure using xslt 2.0. 回答1: The following stylesheet splits the string into a sequence of strings using tokenize() and then recursively calls the "nest" template to create an element for the first item in the sequence and then call the template with the remaining strings to generate the nested elements. <?xml version="1.0" encoding=

XSLT Removal of duplicate with multiple loops

妖精的绣舞 提交于 2019-12-14 03:26:50
问题 I have to convert the below XML using the XSLT. Input XML is <document> <item> <ID>1000909090</ID> <flex> <attrGroupMany name="pageinfo"> <row> <attrQualMany name="pageinput"> <value qual="en">User Intake</value> </attrQualMany> <attrGroupMany name="pagetype"> <row> <attr name="pagemeasure">EXACT</attr> <attrQualMany name="pagecontain"> <value qual="GR1">20</value> <value qual="GR2">21</value> </attrQualMany> </row> <row> <attr name="pagemeasure">EXACT</attr> <attrQualMany name="pagecontain">

Fragment input xhtml to seperate xhtml files with ancestor nodes deails

不问归期 提交于 2019-12-14 02:32:33
问题 Can someone help me on this. Really appreciated. Requirement: To generate separate html files for each pal:fragment element, for the source document attached ,the files gets name based on @fragment-id which is present on the pal:fragment elements. The 'pal:fragment' can be nested, wrapped with 'div' element. The fragmented file not only should include all child elements of pal:fragment, but also should include its ancestor 'div' element. Each separate file generated from 'pal:fragment' should

XSLT 2.0 if condition

谁说我不能喝 提交于 2019-12-13 23:32:05
问题 Need help on XSLT 2.0 transformation. Input xml : <Employee> <Post>Manager</Post> </Employee> pseudo code : if(Employee/Post = 'Manager') then Associate/High = 'Band' else Associate/Low = 'Band' Output xml : <Associate> <High>Band</High> </Associate> <Associate> <Low>Band</Low> </Associate> 回答1: Construct an element dynamically with xsl:element . Other than that, your pseudo code is already pretty accurate. XSLT Stylesheet <?xml version="1.0" encoding="UTF-8" ?> <xsl:transform xmlns:xsl="http

Using Transformer in java for multiple outputs from an XSLT?

廉价感情. 提交于 2019-12-13 20:28:35
问题 I'm currently trying to get my code to call in an xml file and an xsl - then perform the transformation and output multiple outcome files depending on the xml content. import javax.xml.transform.*; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import java.io.File; import java.io.IOException; import java.net.URISyntaxException; public class TestTransformation { public static void main(String[] args) throws TransformerException { System

XSLT 2.0 XPATH intersect

断了今生、忘了曾经 提交于 2019-12-13 20:28:05
问题 Under XSLT 2.0, I am trying to deploy intersect to use an xsl:variable in an XPATH expression. Files at https://xsltfiddle.liberty-development.net/gWmuiK6/1 (problem below at lines 175-192 in the xslt). I declare a variable: <xsl:variable name="app-sources" select="tei:del[@rend='expunctus'] | tei:gap | tei:sic | tei:supplied[@reason='added'] | tei:surplus[@reason='repeated' or @reason='surplus'] | tei:unclear"></xsl:variable> And I am using that variable here with intersect , and it does not

checking condition xslt

感情迁移 提交于 2019-12-13 19:13:00
问题 With the previous post. here is the link Previous Question Again Small Update in input xml the other validation are all same. Here only the chapter (element) is changing instead of chapter i will have numbers <tutorial> <lessons> <lesson> 12000 Bat 20 </lesson> <lesson> 15000 Pen Ball 10~ </lesson> <lesson> 14000 Book </lesson> <lesson> note lesson </lesson> </lessons> <lessons1> <lesson> 24000 Pencil 10 </lesson> <lesson> description page </lesson> <lesson> 8000 Car Tank 25 </lesson> <

Concatenate parent attributes recursively

此生再无相见时 提交于 2019-12-13 18:41:10
问题 Given the following XML: <package> <node name="a"> <node name="b"/> <node name="c"/> <node name="d"> <node name="e"/> <node name="f"/> <node name="g"> <node name="h"/> </node> </node> </node> </package> I basically want to flatten the tree while concatenating the name attributes of each parent node element until the last node element: <package> <node name="a-b"/> <node name="a-c"/> <node name="a-d-e"/> <node name="a-d-f"/> <node name="a-d-g-h"/> </package> What I got working so far is is