xslt-1.0

Inset xslt missing element

岁酱吖の 提交于 2019-12-13 10:28:39
问题 I have a query in the xml and xslt The below is the Input XML <?xml version="1.0" encoding="UTF-8"?> <Employer> <Employees> <EmployeesDetails>van ind 26%</EmployeesDetails> </Employees> <Employees> <EmployeesDetails>van ind</EmployeesDetails> </Employees> The below is my output file <?xml version="1.0" encoding="UTF-8"?> <Employer> <Employees> <Names>van</Names> <Location>ind</Location> <Weather>26</Weather> </Employees> <Employees> <Names>van</Names> <Location>ind</Location> <Weather>100<

How to turn flat xml array into tree? [closed]

柔情痞子 提交于 2019-12-13 10:27:59
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . can someone help with with the following? I need to convert <categories type="array"> <category type="array"> <category-name><![CDATA[Categories]]></category-name> <category-name><![CDATA[BAGS & TRIPODS]]><

I want perform sum of product of two elements at differnt levels

寵の児 提交于 2019-12-13 10:23:02
问题 I tried for following code but its not working. I have taken one string and write XSLT in it and load it XslCompiledTransform object. <xsl:sequence select= "sum(//Item/(cost * related_id/Item/quantity))"/> Source XML: <AML> <Item> <cost> 40 </cost> <related_id> <Item> <quantity>2</quantity> </Item> </related_id> </Item> <Item> <cost> 50 </cost> <related_id> <Item> <quantity>10</quantity> </Item> </related_id> </Item> </AML> 回答1: As I said in the comments, xsl:sequence and that XPath syntax

XSLT transformation into fixed table structure

孤者浪人 提交于 2019-12-13 10:16:28
问题 I have a question regarding XSLT transformation for ouput tables with fixed structure and variable input content. I have outlined 2 different example. The desired output table is 6 columns and two row. But the desired td classes and content are dependent on the input XML I have a previous example to start from provided by @Kirill Polishchuk Extracting a class from the section attribute using xsl Please note I'm working with XSLT 1.0. Any advice or guidance will be much appreciate. Example 1

Summing related values

杀马特。学长 韩版系。学妹 提交于 2019-12-13 09:39:27
问题 I have this .xml <?xml version="1.0" encoding="ISO-8859-1"?> <output> <orders> <order> <id>1</id> <number>10002</number> <type>Loading</type> <date>2013-01-01T02:30:00</date> </order> <order> <id>2</id> <number>10003</number> <type>Loading</type> <date>2013-01-01T010:30:00</date> </order> <order> <id>3</id> <number>10004</number> <type>Loaded</type> <date>2013-01-01T12:30:00</date> </order> </orders> <quantities> <quantity> <id_order>1</id_order> <unit>KG</unit> <value>1000</value> </quantity

string manipulation using xslt tokenize and for-each

冷暖自知 提交于 2019-12-13 09:28:50
问题 i am trying to update the creditcard number in the below xml, tokenize is not working, can you please look what i missing here? Input XML: <Payment> <CreditCardDetails> <CreditCard> <Amount>31.0</Amount> <CreditCardType>American Express</CreditCardType> <CreditHolderName>test</CreditHolderName> <Number>41111111111111</Number> <ExpiryMonth>8</ExpiryMonth> <ExpiryYear>2015</ExpiryYear> </CreditCard> <CreditCard> <Amount>31.0</Amount> <CreditCardType>AMERICAN EXPRESS</CreditCardType>

Should we rewrite the XSL in CDuce?

南楼画角 提交于 2019-12-13 09:23:25
问题 We currently have a huge XSLT transformation that takes 20-30 minutes to process. We need to improve the performance and we are considering CDuce. CDuce looks promising. What is a good approach to doing this? Do we have to rewrite the entire xsl logic in CDuce? 回答1: You could rewrite it in another language but there may be easier options, it depends how efficient that XSLT 1 code is. If it uses // a lot then it is not uncommon to get orders of magnitude speed improvement by rewriting it not

How to split xml data inside an element using xlst?

☆樱花仙子☆ 提交于 2019-12-13 09:17:19
问题 I have xml data like this: <Invoice > <cac:AllowanceCharge> <cbc:ChargeIndicator>false</cbc:ChargeIndicator> <cbc:AllowanceChargeReason>ISK:y!#x!#w!#q!#t!#</cbs:AllowanceChargeReason> <cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric> </Invoice> I must split this AllowanceChargeReason by the !# characters, and put the results in an array. and loop with this array as a result i want to get this result. How can i write xslt code for below result? <table> <xsl:for-each > <tr> .......

Removing line breaks and broken entities using XSLT

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 09:16:19
问题 My XML is being generated from a web form and some users are inserting line breaks and characters that being converted to line breaks \n and broken entities, like &amp; I'm using some variables to convert and remove bad characters, but I don't know how to strip out these types of characters. Here's the method I'm using to convert or strip out other bad characters. Let me know if you need to see the entire XSL. … <xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz_aaea'" /> <xsl

Combining XML using XSLT 1.0 [duplicate]

断了今生、忘了曾经 提交于 2019-12-13 08:59:18
问题 This question already has an answer here : combining xml, xpath or xquery (1 answer) Closed 3 years ago . I need to map the following but its difficult because it has different names: <main> <order> <ID>123</ID> <Name>ABC</Name> </order> <order> <ID>4556</ID> <Name>AAA</Name> <ParentID>123</ParentID> </order> </main> The result should be: <main> <order> <ID>123</ID> <Name>ABC</Name> <order> <ID>4556</ID> <Name>AAA</Name> <ParentID>123</ParentID> </order> </order> </main> 回答1: Like @michael