xslt-2.0

XSLT How to apply recursion to transform from a flat file to a nested tree

為{幸葍}努か 提交于 2021-02-11 17:55:34
问题 I know that there are several other question/answers similar to this, but I haven't read one that addresses my confusion over this transform. I need to move an XML document from this format: <root> <row> <t0>1</t0> <title>Main Title</title> </row> <row> <t0>2</t0> <title>Secondary Title</title> <note>Note</note> </row> <row> <t0>3</t0> <title>Tertiary Title</title> </row> <row> <t0>3</t0> <title>Another Title</title> </row> <row> <t0>2</t0> <title>A Second Secondary Title</title> <note>Note<

How to get the number of rows and SUM of the fields after grouping them in XSLT

为君一笑 提交于 2021-02-11 08:42:26
问题 I have an XML that contains workers and amounts. In the output, the file will contain lines for a worker - one line if he has EX and one line if he has ER. He has EX if he has amount1 in the xml file, and ER if he has amount2. This works perfectly fine in the my current XSLT. The main issue is on how to properly get the correct total number of rows and the sum of all amounts (both amount1 and amount2) after grouping them, and should be added in the header. Here's the sample XML: <Report_Data>

How to pick value of multiple nodes and test it in a single condition?

给你一囗甜甜゛ 提交于 2021-02-11 06:51:31
问题 In continuation to this post, I have restructured the code to better understand my requirement. I have also provided more detail to it. XML FILE <Person> <Name>Kavya</Name> <Gift> <ItemName>PD1</ItemName> </Gift> <Gift> <ItemName>PS1</ItemName> </Gift> <Gift> <ItemName>PD2</ItemName> </Gift> </Person> Now, In the above structure, I need to return a text Successfull only when the Person has a Gift with ItemName that is empty or has only PS1 and not PD1 or PD2 . So, when writing an XSLT file, I

How to count the number of same immediate preceding siblings in xsl

♀尐吖头ヾ 提交于 2021-02-08 20:39:13
问题 I'm using xslt version 2, I'm trying to transform an xml to a fo output, and I'm stuck on a specific problematic. Here is what looks like my input: <a1/> <a1/> <b/> <c/> <d/> <a2/> <b/> <c/> <a1/> <a1/> <a1/> <a1/> <b/> <c/> <d/> This data, functionally speaking, contains a list of 'sets' defined by a1|a2,b?,c?,d?. My problem is that I don't see how I can count the number of a1 tags for a specific 'set'. Indeed, I have written my xsl and I get an output like that: <fo:table> <fo:row> <fo:cell

How to count the number of same immediate preceding siblings in xsl

眉间皱痕 提交于 2021-02-08 20:37:12
问题 I'm using xslt version 2, I'm trying to transform an xml to a fo output, and I'm stuck on a specific problematic. Here is what looks like my input: <a1/> <a1/> <b/> <c/> <d/> <a2/> <b/> <c/> <a1/> <a1/> <a1/> <a1/> <b/> <c/> <d/> This data, functionally speaking, contains a list of 'sets' defined by a1|a2,b?,c?,d?. My problem is that I don't see how I can count the number of a1 tags for a specific 'set'. Indeed, I have written my xsl and I get an output like that: <fo:table> <fo:row> <fo:cell

How to count the number of same immediate preceding siblings in xsl

荒凉一梦 提交于 2021-02-08 20:37:04
问题 I'm using xslt version 2, I'm trying to transform an xml to a fo output, and I'm stuck on a specific problematic. Here is what looks like my input: <a1/> <a1/> <b/> <c/> <d/> <a2/> <b/> <c/> <a1/> <a1/> <a1/> <a1/> <b/> <c/> <d/> This data, functionally speaking, contains a list of 'sets' defined by a1|a2,b?,c?,d?. My problem is that I don't see how I can count the number of a1 tags for a specific 'set'. Indeed, I have written my xsl and I get an output like that: <fo:table> <fo:row> <fo:cell

How to count the number of same immediate preceding siblings in xsl

拟墨画扇 提交于 2021-02-08 20:37:03
问题 I'm using xslt version 2, I'm trying to transform an xml to a fo output, and I'm stuck on a specific problematic. Here is what looks like my input: <a1/> <a1/> <b/> <c/> <d/> <a2/> <b/> <c/> <a1/> <a1/> <a1/> <a1/> <b/> <c/> <d/> This data, functionally speaking, contains a list of 'sets' defined by a1|a2,b?,c?,d?. My problem is that I don't see how I can count the number of a1 tags for a specific 'set'. Indeed, I have written my xsl and I get an output like that: <fo:table> <fo:row> <fo:cell

How to count the number of same immediate preceding siblings in xsl

霸气de小男生 提交于 2021-02-08 20:36:59
问题 I'm using xslt version 2, I'm trying to transform an xml to a fo output, and I'm stuck on a specific problematic. Here is what looks like my input: <a1/> <a1/> <b/> <c/> <d/> <a2/> <b/> <c/> <a1/> <a1/> <a1/> <a1/> <b/> <c/> <d/> This data, functionally speaking, contains a list of 'sets' defined by a1|a2,b?,c?,d?. My problem is that I don't see how I can count the number of a1 tags for a specific 'set'. Indeed, I have written my xsl and I get an output like that: <fo:table> <fo:row> <fo:cell

How to count the number of same immediate preceding siblings in xsl

血红的双手。 提交于 2021-02-08 20:36:49
问题 I'm using xslt version 2, I'm trying to transform an xml to a fo output, and I'm stuck on a specific problematic. Here is what looks like my input: <a1/> <a1/> <b/> <c/> <d/> <a2/> <b/> <c/> <a1/> <a1/> <a1/> <a1/> <b/> <c/> <d/> This data, functionally speaking, contains a list of 'sets' defined by a1|a2,b?,c?,d?. My problem is that I don't see how I can count the number of a1 tags for a specific 'set'. Indeed, I have written my xsl and I get an output like that: <fo:table> <fo:row> <fo:cell

Manage includes in XSL

∥☆過路亽.° 提交于 2021-02-07 18:12:46
问题 I have a code generating XSL that includes several XSL files. The files are included in order to call templates. There can be the case when one of the files that I need to include does not exist in my file. I could create a dummy file with the same name and an empty template when the original file is missing but I would get a duplicate error when the original file exists. Bellow is an example: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org