xslt-1.0

how to access variable in xslt?

你说的曾经没有我的故事 提交于 2020-01-06 18:37:21
问题 could you please tell me how to access variable in xslt ? .I make variable in js .I want to print it's value .So I assign the variable value in xsl:variable when I try to print variable value it gives me string instead of evaluating here is my code http://xsltransform.net/pPJ8LWb <?xml version="1.0" encoding="UTF-8" ?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="html" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8

Str:Tokenize in XSLT not giving expected result

只谈情不闲聊 提交于 2020-01-06 18:04:34
问题 I have a following delimited format file <Sample>PRPS~262772109~K0~LRGLINE=1111112345|40|0|0|1|0|0|0|0|0||X,XXX,621|01/17/2002|01/17/2034|</Sample> I want the following file into this format XML <ResponseType> <XXXXX>262772109</XXXXX> <zzzzz>0</zzzzz> <RGLINE> <Number>1111112345</Number> <ID23>40</ID23> <CCode>0</CCode> <TC>0</TC> <AC>1</AC> <RC>0</RC> <CHECKCODE>0</CHECKCODE> <CODE1>0</CODE1> <VOIDCODE>0</VOIDCODE> <SUBACTIONCODE/> <SEQUENCE>X,XXX,621</SEQUENCE> <EFFECTIVEDATE>01/17/2002<

Str:Tokenize in XSLT not giving expected result

你。 提交于 2020-01-06 17:57:25
问题 I have a following delimited format file <Sample>PRPS~262772109~K0~LRGLINE=1111112345|40|0|0|1|0|0|0|0|0||X,XXX,621|01/17/2002|01/17/2034|</Sample> I want the following file into this format XML <ResponseType> <XXXXX>262772109</XXXXX> <zzzzz>0</zzzzz> <RGLINE> <Number>1111112345</Number> <ID23>40</ID23> <CCode>0</CCode> <TC>0</TC> <AC>1</AC> <RC>0</RC> <CHECKCODE>0</CHECKCODE> <CODE1>0</CODE1> <VOIDCODE>0</VOIDCODE> <SUBACTIONCODE/> <SEQUENCE>X,XXX,621</SEQUENCE> <EFFECTIVEDATE>01/17/2002<

Grouping on a Node-Set in XSLT

半腔热情 提交于 2020-01-06 08:29:36
问题 I'm aware of the Muenchian grouping method for XSLT, but all implementations I've seen rely on a single node as the value to group on. In this case I'd like to group on a node-set. In the input below I'd like to group on outputs/output part ref. I've tried to construct keys such as <xsl:key name="refsKey" match="/processes/process" use="outputs/output_part_ref"/> Of course outputs/output_part_ref matches the first node and doesn't match the node-set. Input <?xml version="1.0" encoding="UTF-8"

Copying and adding a parent node with multiple children

不打扰是莪最后的温柔 提交于 2020-01-06 07:23:13
问题 I made an error on a previous post. I have XML data that works like this (this is only an example and number of chapters and pages are both variable). <books> <chapter></chapter> <page></page> <page></page> <page></page> <chapter></chapter> <page></page> <page></page> <chapter></chapter> <page></page> <page></page> <page></page> <page></page> </books> I am trying to recreate it to look like this <books> <book> <chapter></chapter> <page></page> <page></page> <page></page> </book> <book>

Merge XML nodes based on Certain Key Value using XSLT

跟風遠走 提交于 2020-01-06 05:53:10
问题 Merge XML nodes based on ReferenceNumber Value How to merge the xml request to the output given below using XSLT based on the Key value. Basically the xml response has to be merged for ReferenceNumber, along with the respective ProductCode and SecondaryDivision. Below is the Request and the Expected response. I tried Using following XSLT but it did not gave desired result. Below is the XSLT <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:key name="refNo"

Merge XML nodes based on Certain Key Value using XSLT

浪尽此生 提交于 2020-01-06 05:52:06
问题 Merge XML nodes based on ReferenceNumber Value How to merge the xml request to the output given below using XSLT based on the Key value. Basically the xml response has to be merged for ReferenceNumber, along with the respective ProductCode and SecondaryDivision. Below is the Request and the Expected response. I tried Using following XSLT but it did not gave desired result. Below is the XSLT <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:key name="refNo"

xslt xml getting first occurrence and merging the tags

徘徊边缘 提交于 2020-01-06 05:41:05
问题 Below is the XML and I am looking for output as below Input XML (xml version="1.0") <dynamic> <rpc xmlns="http://namespace/example" > <route> <table> <tablename>employee</tablename> <count>20</count> </table> <table> <tablename>employee</tablename> <count> 21</count> <rt> 1</rt> <rt> 2</rt> <rt> 3</rt> <rt> 4</rt> </table> <table> <tablename>dept</tablename> <count>20</count> <rt> a</rt> <rt> b</rt> <rt> c</rt> </table> <table> <tablename>dept</tablename> <count>44</count> <rt> d</rt> <rt> e<

XSL 1.0 group by and sum SalesAmount and related / joined Tax records

笑着哭i 提交于 2020-01-06 04:51:06
问题 I have an invoice xml where I need to perform a grouping / sum on itemid's For instance for ItemId 444 I need a lineamount of 100 + 25 = 125 and ItemId 555 = 200 + 15. Lot's of examples out there how to do this you're about to say but I have another requirement. I also need to do the same grouping and sum for my TaxTrans\TaxAmounts and TaxTrans\TaxBaseAmounts based on the joining InventTransId field (AABB / BBCC) between CustInvoiceTrans and TaxTrans. Before: <CustInvoiceJour class="entity">

How to group consecutive dates in XSLT?

巧了我就是萌 提交于 2020-01-06 04:45:06
问题 I have an xml file (sample below) and I want to group this xml based on consecutive Time_Off_Date. <Root> <Entry> <Employee_ID>101</Employee_ID> <Time_Off_Details> <Time_Off_Date>2017-12-01</Time_Off_Date> </Time_Off_Details> <Time_Off_Details> <Time_Off_Date>2017-12-02</Time_Off_Date> </Time_Off_Details> <Time_Off_Details> <Time_Off_Date>2017-12-04</Time_Off_Date> </Time_Off_Details> <Time_Off_Details> <Time_Off_Date>2017-12-05</Time_Off_Date> </Time_Off_Details> </Entry> <Entry> <Employee