xslt-2.0

XSLT Mapping using foreach

我只是一个虾纸丫 提交于 2019-12-25 04:13:34
问题 This is the sample XML data that i am using and then i have to pass all the values to an additional properties tag.. <ns1:Quote> <ns1:QuoteVendor>123</ns1:QuoteVendor> <ns1:QuoteNumber>sai</ns1:QuoteNumber> <ns1:QuoteVersion>sri</ns1:QuoteVersion> <ns1:QuoteValue>sas</ns1:QuoteValue> <ns1:QuoteProperty>sandy</ns1:QuoteProperty> </ns1:Quote> After transformation using XSLT i am expecting the format as <AdditionalProperties> <ns1:Properties> <ns1:Propertyname>QuoteVendor</ns1:Propertyname> <ns1

Why is xsl:when not working as expected?

百般思念 提交于 2019-12-25 04:11:49
问题 I am a beginner to the XSLT and I am a bit confused on how to use xsl:when . Please find my sample XSLT code below with expected output and the actual output I am getting from the XSLT. Could you please suggest your solution and explain what I am doing incorrect while using xsl:when . XML <source> <bold>Hello, world.</bold> <italic>fine.</italic> <red>I am </red> </source> XSLT <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs=

Looping Element to Single Element in XSLT

大憨熊 提交于 2019-12-25 04:04:21
问题 I need to convert the following content <QTLS_ITEM> <ID>123</ID> <ID1>1345</ID1> <SERAIL_NUMBER>1026977­04257</SERAIL_NUMBER> <PROD_NAME>upgrade</PROD_NAME> </QTLS_ITEM> <QTLS_ITEM> <ID>123</ID> <ID1>1345</ID1> <SERAIL_NUMBER>1026977­04257</SERAIL_NUMBER> <PROD_NAME>Plug­in</PROD_NAME> </QTLS_ITEM> <QTLS_ITEM> <ID>123</ID> <ID1>1345</ID1> <SERAIL_NUMBER>1026977­04257</SERAIL_NUMBER> <PROD_NAME>License</PROD_NAME> </QTLS_ITEM> This is a looping element type. <QTLS_ITEM> is a repeating element.

Multiple rows using XSLT

守給你的承諾、 提交于 2019-12-25 04:02:05
问题 I appreciate if anyone could help me on this. I have an XML that looks like this: <root> <worker> <Primary_Key>12345</Primary_Key> <First_Name>ABC</First_Name> <Last_Name>DEF</Last_Name> <Multiple_Data> <Code>MO</Code> <Amount>35</Amount> </Multiple_Data> <Multiple_Data> <Code>PA</Code> <Amount>45</Amount> </Multiple_Data> </worker> <worker> <Primary_Key>67890</Primary_Key> <First_Name>GHI</First_Name> <Last_Name>JKL</Last_Name> <Multiple_Data> <Code>PA</Code> <Amount>25</Amount> </Multiple

How to apply XSLT to embedded XML in another XML

混江龙づ霸主 提交于 2019-12-25 04:00:34
问题 given the following XML: <?xml version="1.0" encoding="UTF-8"?> <root> <report> <![CDATA[<?xml version="1.0" encoding="UTF-8"?><whatever><title>GREETING</title><greeting>Hi</greeting><name>Dave</name></whatever>]]> </report> </root> How can I use XSL-T to take into account this "embedded" XML? An example output I would want to get after XSL-Transformations is like this: <?xml version="1.0" encoding="UTF-8"?> <TransformedRoot> <data><html><head><title>GREETING</title></head><body><p>Hi, Dave!<

XSLT 2.0 test tokenized results for no value

穿精又带淫゛_ 提交于 2019-12-25 03:34:09
问题 In XSLT 2.0 I am handling a string delimited by ~ . There are times that the tokenized results contain an instance of 'nothing' between two ~ . I try to test for this using empty() <xsl:for-each select="tokenize($list_of_items,'~')"> <xsl:if test="not(empty(.))"> ...do something here... </xsl:if> </xsl:for-each> ...which doesn't work. What is the correct way to test for nothing/empty/blank value in a tokenized list? 回答1: tokenize gives you a sequence of strings, if you have an input with two

How to insert a new ELEMENT after a node in XQuery?

亡梦爱人 提交于 2019-12-25 03:29:12
问题 I want to insert a node using below code but if i will rerun the code i don't want my node to be repeated twice if all the elements are having same value- let $doc := fn:doc("abc.xml") (: abc.xml looks like-- <root> <value1>somevalue</value1> <value2>somevalue</value2> <value3>somevalue</value3> <value4>somevalue</value4> <Country>Australia</Country> <value6>somevalue</value6> <value7>somevalue</value7> <value8>somevalue</value8> <value9>somevalue</value9> <value10>somevalue</value10> </root>

How to Increment 1 day in Date using XSLT

余生颓废 提交于 2019-12-25 02:51:49
问题 I have a scenario in which we need to increment 1 day in existing date. Like In <subscriptionDate>2015-05-06</subscriptionDate> I want to increase 1 day and map its value to <terminationDate>2015-05-07</terminationDate> . How can I achieve this using XSLT. So, all date constraints should also be handled. like if day is 31 then increment in month. <Subscription code="12345678R1"> <userAccount>40000005b</userAccount> <offerTemplate>Test</offerTemplate> <subscriptionDate>2015-05-06<

How to Increment 1 day in Date using XSLT

坚强是说给别人听的谎言 提交于 2019-12-25 02:51:10
问题 I have a scenario in which we need to increment 1 day in existing date. Like In <subscriptionDate>2015-05-06</subscriptionDate> I want to increase 1 day and map its value to <terminationDate>2015-05-07</terminationDate> . How can I achieve this using XSLT. So, all date constraints should also be handled. like if day is 31 then increment in month. <Subscription code="12345678R1"> <userAccount>40000005b</userAccount> <offerTemplate>Test</offerTemplate> <subscriptionDate>2015-05-06<

What are XSLT Result Trees

好久不见. 提交于 2019-12-25 02:44:55
问题 I am reading a book on XSLT 2.0. I am on the chapter of XSLT Result Trees. Frankly, i don't understand it a bit. What are result trees? What is it used for? Why is it important? 回答1: From the W3C XSLT 2.0 Specification : "[Definition: The term result tree is used to refer to any tree constructed by instructions in the stylesheet. A result tree is either a final result tree or a temporary tree.] [Definition: A final result tree is a result tree that forms part of the final output of a