xslt-grouping

XSLT, sort and group by year-date

半腔热情 提交于 2019-12-13 11:35:39
问题 Regarding Umbraco XSLT version 1. I have aprox. 150 news items in XML. Lets say like this (all is pseudocode until I get more familiar with this xml/xslt): <news> <data alias=date>2008-10-20</data> </news> <news> <data alias=date>2009-11-25</data> </news><news> <data alias=date>2009-11-20</data> </news> etc. etc.... I would like to run through the XML and create html-output as a news archive. Something like (tags not important): 2008 Jan Feb ... 2009 Jan Feb Mar etc. etc. I can only come up

xslt grouping by calling template

﹥>﹥吖頭↗ 提交于 2019-12-13 10:47:18
问题 I am new to xslt and trying to learn how to learn grouping using keys and using templates. Can somebody help me on how can do the following in xslt. I have to call a template from another template to do the transformation. Thanks here is my xml. <Doc> <ExOrder>121</ExOrder> <Line> <Ordernumber>225</Ordernumber> <OrderID>1</OrderID> <Quantity>5</Quantity> </Line> <Line> <Ordernumber>225</Ordernumber> <OrderID>5</OrderID> <Quantity>5</Quantity> </Line> <Line> <Ordernumber>226</Ordernumber>

Grouping based on conditions and putting them into a single row in XSLT Transformation

爱⌒轻易说出口 提交于 2019-12-13 06:54:48
问题 I am facing a problem in transformation of XML. I need to transform an output in csv file as with ',' seperated. XML: <Root> <Employees> <Employee> <Co_Code>DEEP1</Co_Code> <ID>12345</ID> </Employee> <Type Descriptor="Phone"></Type> <amount1>8</amount1> </Employees> <Employees> <Employee> <Co_Code>DEEP1</Co_Code> <ID>12345</ID> </Employee> <Type Descriptor="Phone"></Type> <amount>6</amount> </Employees> <Employees> <Employee> <Co_Code>DEEP1</Co_Code> <ID>12345</ID> </Employee> <Type

How to extend a Muenchian XML grouping?

此生再无相见时 提交于 2019-12-13 04:32:02
问题 I have this XML: <events> <event name="Christmas" attendees="1"/> <event name="Halloween" attendees="3"/> <event name="Easter" attendees="2"/> <event name="Easter" attendees="1"/> </events> Thanks to hr_117 's help, I managed to do this: <xsl:template match="data"> <xsl:apply-templates select="events"/> </xsl:template> <xsl:key name="events-by-name" match="events/event" use="@name" /> <xsl:template match="events"> <xsl:for-each select="event[count(. | key('events-by-name', @name)[1]) = 1]">

sum of count in xslt-3

£可爱£侵袭症+ 提交于 2019-12-13 04:08:39
问题 Given the following example, https://xsltfiddle.liberty-development.net/3NzcBsV each description must occur only once. How one could add in the first row of the output report the number of description elements that have occurred more than once in the xml file under question? Desired output: 3 (because "Light Belgian waffles covered with an assortment of fresh berries and whipped cream" was found 2 times, and "Two of our famous Belgian Waffles with plenty of real maple [syrup]" was found 3

Counting distinct items in XSLT

我是研究僧i 提交于 2019-12-12 20:13:50
问题 I have XML like this: <assessment> <variables> <variable> <attributes> <variable_name value="FRED"/> </attributes> </variable> </variables> <variables> <variable> <attributes> <variable_name value="MORTIMER"/> </attributes> </variable> </variables> <variables> <variable> <attributes> <variable_name value="FRED"/> </attributes> </variable> </variables> </assessment> I know that with this XSLT: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method=

Grouping based on the node value if only it exists using XSLT 1.0

烂漫一生 提交于 2019-12-12 04:58:32
问题 My requirement is slightly complex one.I have to use only XSLT 1.0. I could able to get the solution using XSLT 2.0, but I need the solution using 1.0. I have the following input xml: <?xml version="1.0" encoding="UTF-8"?> <results> <row> <CASEID>C1</CASEID> <CASEBA>MEDICAID</CASEBA> <ISSUEID>I1</ISSUEID> <ISSUEBA>MEDICAID</ISSUEBA> <OBJECTID>1</OBJECTID> <OBJECTBA>MEDICAID</OBJECTBA> </row> <row> <CASEID>C1</CASEID> <CASEBA>MEDICAID</CASEBA> <ISSUEID>I2</ISSUEID> <ISSUEBA>MEDICAID</ISSUEBA>

Creating alphabetical index with fixed number of columns in XSLT 2.0

本秂侑毒 提交于 2019-12-12 04:07:01
问题 I have an XML like this: <xml version="1.0" encoding="UTF-8"?> <countries> <country> <name>Latvia</name> </country> <country> <name>USA</name> </country> <country> <name>Australia</name> </country> <country> <name>Indonesia</name> </country> <country> <name>UK</name> </country> <country> <name>India</name> </country> <country> <name>Argentina</name> </country> <country> <name>Chile</name> </country> <country> <name>Singapore</name> </country> <country> <name>New Zeland</name> </country>

how to show only two items in xslt?

流过昼夜 提交于 2019-12-12 03:40:56
问题 could yu please tell me how to show first two element is xslt ? here is my code http://xsltransform.net/ehVYZMp/6 <?xml version="1.0" encoding="UTF-8" ?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl"> <xsl:output method="html" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" /> <xsl:template match="a"> <hmtl> <head> <title>New Version!</title> </head>

How do i append input xml attribute into name of multiple output xml file using XSLT

风流意气都作罢 提交于 2019-12-12 03:34:54
问题 We have following input xml file in which we are trying XSLT processing instructions. ** Complete Input XML file :** It consist of Loop element as StockLineItem.for every single OrderHeader and OrderDetails we can have many StockineItems. Document tells single SalesforceOrderNumber element only. Hence We have to Output this element with xml Filename on each XML write. <?xml version="1.0" encoding="Windows-1252"?> <SalesOrders xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd