xslt-2.0

finding maximum depth of chapter

大憨熊 提交于 2019-12-13 15:24:04
问题 everyone . In this case ,I want to conpute the maxximun depth of the chapter.For instance, a book without chapters has height 0 . A book only has chapters with no sections ,the height should be 1.The folowing is xml: <book title="D"> <author> <name>abc</name> </author> <chapter title="chapter1"> <section title="section1.1"/> <section title="section1.2"> <section title="section1.2.1"/> <section title="section1.2.2"/> </section> <section title="section1.3"> <section title="section1.3.1"/> <

XSLT :Condition for check if null and empty element then only assign value to other element

耗尽温柔 提交于 2019-12-13 11:09:49
问题 We have input XML.In that,StockCode element is empty for many line items (OrderLineID elements). For all empty StockCode element in XML there must be Comment element value. Similarly,For all such empty Comment elements there must be StockCode Value Exist. Note : OrderDetail is repeating Node here. Scenario : We have to split OrderDescription string . such a way that it always look for empty StockCode element. then only Assign split string values to Comment elements. Otherwise for all

Unbounded XML Element to name/value pairs without repeating Element names in XSLT

岁酱吖の 提交于 2019-12-13 10:57:25
问题 I have written an xslt to convert an input xml file to name/value pairs. The input xml is as follows: INPUT.xml <?xml version="1.0" encoding="UTF-8" ?> <EMailData> <PersonInfo> <PersonID>PersonID1092</PersonID> <EmailAddress>EmailAddress1093</EmailAddress> <SecureToken>SecureToken1094</SecureToken> <ContactPrimaryChannel>ContactPrimaryChannel1172</ContactPrimaryChannel> <Order> <OrderID>OrderID1224</OrderID> <CustomerOrderNumber>CustomerOrderNumber1225</CustomerOrderNumber> <OrderType/>

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<

xslt summing the totals in an invoice [closed]

喜夏-厌秋 提交于 2019-12-13 09:49:41
问题 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 7 years ago . am wondering how i can up with an xslt sheet for to show the invoice total per customer.please help,.tried my best with recursive but nothing seems to give way,.for-each loop only gives me the total of all the

Total of true and false in current time

送分小仙女□ 提交于 2019-12-13 09:08:44
问题 I have got this XML document. Is there way how to sort the nodes by ascending time and by brand and then count how many cars (samples), true and false was in this time from start time (always the lowest time in the group)? <?xml version="1.0" encoding="UTF-8"?> <trade> <car time="1950" brand="audi" trend="true"> </car> <car time="1200" brand="renault" trend="true"> </car> <car time="1000" brand="audi" trend="true"> </car> <car time="2800" brand="renault" trend="true"> </car> <car time="2000"

Renaming an element with name Standard into Product using xslt

感情迁移 提交于 2019-12-13 08:33:36
问题 I had to transform following xml input, <Standards xmlns="http://ws.wso2.org/dataservice"> <Standard> <ProductID>200057</ProductID> <Prefix>ISO</Prefix> <SNumber>1001</SNumber> <DraftProducts> <RelatedProduct> <ProductID>1500163</ProductID> </RelatedProduct> </DraftProducts> <ReferenceProducts> <RelatedProduct> <ProductID>263973</ProductID> <RelationId>708519</RelationId> <Designation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/> </RelatedProduct> <RelatedProduct>

Chunk string with XSLT

≡放荡痞女 提交于 2019-12-13 08:19:10
问题 I have an XML with a text node, and I need to split this string into multiple chunks using XSLT 2.0. For example: <tag> <text>This is a long string 1This is a long string 2This is a long string 3This is a long string 4</text> </tag> The output should be: <tag> <text>This is a long string 1</text> <text>This is a long string 2</text> <text>This is a long string 3</text> <text>This is a long string 4</text> </tag> Note that I deliberately set the chunk size to the length of each statement so

XSLT 2.0 Grouping, Summing, Counting and Conditions

流过昼夜 提交于 2019-12-13 08:10:27
问题 I have XSLT that is grouping the input, summing the current-group, and only outputting a record if the sum meets a certain condition. The for-each-group works fine, but I can't get an accurate record count for a trailer record. Here's a sample input: <Book_Data> <Book_Entry> <Book> <Book_ID>1</Book_ID> <Book_Name>Test1</Book_Name> </Book> <Sales> <Quantity>2</Quantity> </Sales> <Book_Entry> <Book_Entry> <Book> <Book_ID>1</Book_ID> <Book_Name>Test1</Book_Name> </Book> <Sales> <Quantity>3<

XSLT convert xml block under a specific node to xml-escaped content of that node

北城以北 提交于 2019-12-13 07:43:22
问题 Any ideas of how the following problem can be solved would be highly appreciated. INPUT: <p> <div> Original<br/>This is the original <b>acid</b>, a hydroxy monocarboxylic <span class="hl1">acid</span>. </div> </p> Desired Output: <p> <div> Original<br/>This is the original <b>acid</b>, a hydroxy monocarboxylic <span class="hl1">acid</span>. </div> </p> Attempt 1: `<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output omit-xml-declaration="yes" indent="no