xslt-1.0

Concatenate Strings including repeating tag

我的梦境 提交于 2019-12-25 13:10:18
问题 I have this Input XML: <?xml version='1.0' encoding='UTF-8'?> <Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn-sample"> <CustomerRecord> <Statement> <StmtId>123</StmtId> <StmtDate>2013-08-16</StmtDate> <AcctNumber>123456789</AcctNumber> <Balance> <Type>OP</Type> <Amount>1.00</Amount> <CreditOrDebit>DR</CreditOrDebit> <Date>2013-08-15</Date> </Balance> <Balance> <Type>CL</Type> <Amount>2.00</Amount> <CreditOrDebit>CR</CreditOrDebit> <Date>2013-08-16</Date> </Balance>

Converting Date Timestamp to EPOCH via XSL

旧时模样 提交于 2019-12-25 09:47:55
问题 Apologies in advanced for the large block of code. I am able to output a timestamp with the code below. I would now like it to output in an EPOCH format. I cant seem to get anything to work looking at other submitted tickets. I am admittedly a bit of noob to XSL. I am confined to XSL1 Any help is appreciated. Thank you in advanced. <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ms="urn:schemas-microsoft-com:xslt"

Flat to hierarchical XML transformation

折月煮酒 提交于 2019-12-25 08:26:49
问题 Here is the source XML: <CellData> <Cell CellOrdinal="0"> <Value>actual</Value> <FmtValue>actual</FmtValue> </Cell> <Cell CellOrdinal="1"> <Value>630961942</Value> <FmtValue>630961942</FmtValue> </Cell> <Cell CellOrdinal="2"> <Value>2.045711422E7</Value> <FmtValue>20457114.2200</FmtValue> </Cell> <Cell CellOrdinal="3"> <Value>9.997105219639378E1</Value> <FmtValue>99.9711</FmtValue> </Cell> <Cell CellOrdinal="4"> <Value>3.33E1</Value> <FmtValue>33.0000</FmtValue> </Cell> <Cell CellOrdinal="5">

XSLT transformation to group similar tags

落花浮王杯 提交于 2019-12-25 08:08:43
问题 I have this XML with players and citizens sections. Each section has multiple person tags. <?xml version="1.0" encoding="UTF-8"?> <test> <players> <person> <name>joe</name> <age>20</age> </person> <person> <name>sam</name> <age>23</age> </person> </players> <citizens> <person> <name>joe</name> <city>ny</city> </person> <person> <name>sam</name> <city>london</city> </person> </citizens> </test> Now I want to transform this so that person tags of, players and citizens sections are merged

Copying node attribute to a new node in xslt

怎甘沉沦 提交于 2019-12-25 07:55:20
问题 I have the xml like this: <definitions xmlns:xxx="test.com" xmlns:yyy="test2.com" test="test"> </definitions> which I need to convert like this: <test xmlns:xxx="test.com" xmlns:yyy="test2.com" test="test"> </test> I wrote an xslt like this: <xsl:template match="definitions"> <xsl:element name="test"> <xsl:copy-of select="@*" /> </xsl:element> </xsl:template> this produces: <test test="test"> </test> but it doesnt contain xmlns:xxx="test.com" xmlns:yyy="test2.com" namespaces why? How can I

XSLT add not existing nodes

為{幸葍}努か 提交于 2019-12-25 07:48:16
问题 I have an XML fragment like this <lines> <item><code>1.1</code><amt>1000.00</amt></item> <item><code>1.3.1</code><amt>2000.00</amt></item> <item><code>1.3.2</code><amt>3000.00</amt></item> <item><code>2.1</code><amt>4000.00</amt></item> ... </lines> I want to make a sum of all 1* nodes. The full list is known so I can write something like: <xsl:value-of select="item[code=1.1]/amt + item[code=1.2]/amt + item[code=1.3.1]/amt + item[code=1.3.2]/amt"/> The issue is that any (even all) of those

Slightly complex grouping based on node values using XSLT 1.0

谁说我不能喝 提交于 2019-12-25 06:31:11
问题 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: <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> <OBJECTID>2</OBJECTID> <OBJECTBA

XSLT 1.0: find the maximum value from given date and time

…衆ロ難τιáo~ 提交于 2019-12-25 06:14:06
问题 Hi all, I have the xml event in the following format (month,date,year,hour,minute,seconds AM/PM). I would like to mention that, I don't have the control over the generated XML. Now I need to find the maximum or latest "dateevent" and select the corresponding "eventname". The XML looks like <?xml version="1.0" standalone="no"?> <day> <day-event> <eventname>Test1</eventname> <dateevent>1/30/2014 7:15:50 AM</dateevent> </day-event> <day-event> <eventname>Test2</eventname> <dateevent>4/29/2015 6

Change multiple values in an XML file to those referenced in another XML file

≡放荡痞女 提交于 2019-12-25 06:07:33
问题 I have a large XML file and I need to change certain values in it where the ID number (OWNINST) matches one in another XML file. My large XML file 'file1.xml' is in the following format: <institution> <ukprn>1234</ukprn> <course> <courseID>1</courseID> <courseaim>X99</courseaim> </course> <student> <birthdate>30/10/1985</birthdate> <instance> <OWNINST>123456|5</OWNINST> <FC>1</FC> <STULOAD>100</STULOAD> <elq>4</elq> <MODE>31</MODE> </instance> </student> <student> <birthdate>01/02/1999<

XSLT copy elements from second XML if an attribute is set in the first XML

谁都会走 提交于 2019-12-25 05:29:09
问题 I have the following input XMLs: car.xml: <car ref-id="parts.xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <color>red</color> <tire>michelin</tire> <engines override="false"> <engine> <model>Z</model> </engine> </engines> <hifi>pioneer</hifi> </car> parts.xml: <?xml version="1.0" encoding="UTF-8"?> <parts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <engines> <engine> <model>X</model> </engine> <engine> <model>Y</model> </engine> </engines> <tire>goodyear</tire> <color