Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

Conditional increment in xslt

Ads

 
 

Share on Google+Share on Google+

suma
Conditional increment in xslt
0 Answer(s)      4 years and 4 months ago
Posted in : XML
In a Shipment the number of orders is present. For each order there is a number of order line Items. Order Line Items contain item. For each iteration we are maintaining the hierarchy levels. In the orderLine Items section, if the previous item is equal to current item, there is no need to increment hierarchy.

points:

There is only one shipment
Number of orders are present per shipment.
number of orderLineItems per each order.
for each iteration of orders and orderlineItems we have to maintain a hierarchy levels(increment value),but when comes to orderLineItems one condition is there if the previous item is equals to Current item,no need to increment hierarchy level.otherwise we should increment the hierarchy levels like below output we needed.

below is the input.

Input:
<Shipment>
<Shipment1>Shipment151</Shipment1>
<ShipmentValue>ShipmentValue52</ShipmentValue>
<Order>
<Orderlevel1>Orderlevel153</Orderlevel1>
<Orderlevel2>Orderlevel254</Orderlevel2>
<Orderlevel3>Orderlevel355</Orderlevel3>
<OrderLineItems>
<Level1>Level156</Level1>
<Level2>Level257</Level2>
<Level3>Level358</Level3>
<Item>Item59</Item>
</OrderLineItems>
<OrderLineItems>
<Level1>Level160</Level1>
<Level2>Level261</Level2>
<Level3>Level362</Level3>
<Item>Item59</Item>
</OrderLineItems>
<OrderLineItems>
<Level1>Level164</Level1>
<Level2>Level265</Level2>
<Level3>Level366</Level3>
<Item>Item63</Item>
</OrderLineItems>
</Order>
<Order>
<Orderlevel1>Orderlevel168</Orderlevel1>
<Orderlevel2>Orderlevel269</Orderlevel2>
<Orderlevel3>Orderlevel370</Orderlevel3>
<OrderLineItems>
<Level1>Level171</Level1>
<Level2>Level272</Level2>
<Level3>Level373</Level3>
<Item>Item74</Item>
</OrderLineItems>
<OrderLineItems>
<Level1>Level175</Level1>
<Level2>Level276</Level2>
<Level3>Level377</Level3>
<Item>Item78</Item>
</OrderLineItems>
<OrderLineItems>
<Level1>Level179</Level1>
<Level2>Level280</Level2>
<Level3>Level381</Level3>
<Item>Item78</Item>
</OrderLineItems>
</Order>
</Shipment>

below is the output we need.

Output:

<ns1:Shipment>
<ns1:Shipment1>1</ns1:Shipment1>
<ns1:ShipmentValue>S</ns1:ShipmentValue>
<ns1:Order>
<ns1:Orderlevel1>2</ns1:Orderlevel1>
<ns1:Orderlevel2>1</ns1:Orderlevel2>
<ns1:Orderlevel3>O</ns1:Orderlevel3>
<ns1:OrderLineItems>
<ns1:Level1>3</ns1:Level1>
<ns1:Level2>2</ns1:Level2>
<ns1:Level3>I</ns1:Level3>
<ns1:Item>Item59</ns1:Item>
</ns1:OrderLineItems>
<ns1:OrderLineItems>
<ns1:Item>Item59</ns1:Item>
</ns1:OrderLineItems>
<ns1:OrderLineItems>
<ns1:Level1>4</ns1:Level1>
<ns1:Level2>2</ns1:Level2>
<ns1:Level3>I</ns1:Level3>
<ns1:Item>Item63</ns1:Item>
</ns1:OrderLineItems>
</ns1:Order>
<ns1:Order>
<ns1:Orderlevel1>5</ns1:Orderlevel1>
<ns1:Orderlevel2>1</ns1:Orderlevel2>
<ns1:Orderlevel3>O</ns1:Orderlevel3>
<ns1:OrderLineItems>
<ns1:Level1>6</ns1:Level1>
<ns1:Level2>5</ns1:Level2>
<ns1:Level3>I</ns1:Level3>
<Item>Item74</Item>
</ns1:OrderLineItems>
<ns1:OrderLineItems>
<ns1:Level1>7</ns1:Level1>
<ns1:Level2>5</ns1:Level2>
<ns1:Level3>I</ns1:Level3>
<Item>Item78</Item>
</ns1:OrderLineItems> 
<ns1:OrderLineItems>
<ns1:Item>Item78</ns1:Item>
</ns1:OrderLineItems>
</ns1:Order>
</ns1:Shipment>
Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
Conditional increment in xslt
Conditional increment in xslt  In a Shipment the number of orders..., there is no need to increment hierarchy. points: There is only one shipment Number... levels(increment value),but when comes to orderLineItems one condition
Conditional increment in xslt
Conditional increment in xslt  In a Shipment the number of orders..., there is no need to increment hierarchy. points: There is only one shipment Number... levels(increment value),but when comes to orderLineItems one condition
Advertisements
Conditional increment in xslt
Conditional increment in xslt  In a Shipment the number of orders..., there is no need to increment hierarchy. points: There is only one shipment Number... levels(increment value),but when comes to orderLineItems one condition
XSLT
XSLT In this section we will discuss about XSLT and understand the different use of XSLT. The XSLT stands for the Extensible Style sheet Language... etc. There are API's in Java and other programming langauges for XSLT
xslt logging
xslt logging  am working with xslt and want to log the user actions like clicking on the button and clicking on the text field etc. Can anyone plss tell me Is that possible..?? Thanks in advance
cONDITIONAL STATEMENT
cONDITIONAL STATEMENT    Write a program that computes and assesses the tuition fee of the students in one trimester, based on the given mode of payment below: Plan (Key) Discount (-) or Interest (+) Cash (1) 10% Discount Two
endif to end the conditional statement.
endif to end the conditional statement.  When are you supposed to use endif to end the conditional statement
conditional statement in java
conditional statement in java  Write a conditional statement in Java... as conditional statements. You can learn "How to write conditional statement in Java " from RoseIndia website. Find the Link below... conditional operators
Orangevolt XSLT
Orangevolt XSLT       OrangevoltXSLT for Eclipse provides XSLT support... XMLWrite XSLT development environment providing many great enhancements
Stumped with NOT NULL AUTO_INCREMENT
to create a new table with the ID column being NOT NULL AUTO_INCREMENT. The table will create if I do not have NOT NULL AUTO_INCREMENT, but it WILL NOT create..._INCREMENT, user_id INT(11), courseid INT(10
Explain the ternary conditional operator in PHP?
Explain the ternary conditional operator in PHP?  Explain the ternary conditional operator in PHP
Version of fulcrum>fulcrum-xslt dependency
List of Version of fulcrum>fulcrum-xslt dependency
XSLT Introductions
XSLT Introductions XSLT is an xml based language for transforming XML documents into other XML documents. XSLT stands for eXtensible Styles Language... Transformations (XSLT) and eXtensible Stylesheet Language - Formatting Objects (XSL-FO
Conditional Statement in Turbo C
Conditional Statement in Turbo C   Write a program that computes and assesses the tuition fee of the students in one trimester, based on the given mode of payment below: Plan (Key) Discount (-) or Interest (+) Cash (1) 10
Conditional Statement in Turbo C
Conditional Statement in Turbo C   Write a program that computes and assesses the tuition fee of the students in one trimester, based on the given mode of payment below: Plan (Key) Discount (-) or Interest (+) Cash (1) 10
MySQL Auto_Increment
MySQL Auto_Increment This example illustrates how to define AUTO_INCREMENT of a field. The AUTO_INCREMENT attribute can be used to generate a unique... AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (id
turbo c pre-increment question
turbo c pre-increment question  Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times
Backbase XML/XSLT/Xpath
Backbase XML/XSLT/Xpath       Backbase Enterprise Ajax is targeted at developers who need to create more... XML. The Backbase Ajax Engine includes client-side XSLT and XPath engines. Read
Java Increment Date. - Java Beginners
Java Increment Date.  Create a program called Date.java to perform.... Also, provide a method nextDay() to increment the day by one. The Date object... ) nextDay(); } // Increment the Month public
Using the jQuery Transform plug-in(XSLT)
Using the jQuery Transform plug-in(XSLT)       Using the jQuery Transform plug-in(XSLT) XSLT stands for XSL Transformations (Extensible Stylesheet
Passing parameters to XSLT style sheets
Passing parameters to XSLT style sheets       Passing parameters to XSLT style sheets...() { // For display purposes only $.ajax({ url: 'xslt-test.xml'
PHP Increment Decrement Operator
of increment and decrement, much like C,C++. but in few cases it follows Perl style...: <?php $a=12; echo "Pre increment value of a is:".++$a."<br/>"; echo "Post increment value of a is:"
query regarding auto increment primary key
query regarding auto increment primary key  i want to use s1,s2.... as my auto increment primary key.cant i do this in mysql
Version of com.intersult>xslt-maven-plugin dependency
List of Version of com.intersult>xslt-maven-plugin dependency
Version of com.ocpsoft>ocpsoft-docbook-xslt dependency
List of Version of com.ocpsoft>ocpsoft-docbook-xslt dependency
Conditional operator in java
Conditional operator in java Operator are used to perform some specific operation. In this tutorial we will discuss about conditional operator in java. Conditional operator is used to evaluate boolean expression which return or false
How to auto increment primary key in mysql...
How to auto increment primary key in mysql...  How to auto increment primary key in mysql... and one more thing i need to get auto increment value in front end each time for inserting the value[JSP
Maven Dependency fulcrum-xslt >> 1.0.3
You should include the dependency code given in this page to add Maven Dependency of fulcrum >> fulcrum-xslt version1.0.3 in your project
Conditional (Logical) Operators
Conditional (Logical) Operators       Conditional operators return a true or a false value based on the state of the variables i.e. the operations using conditional
An XSLT Stylesheet
.style1 { border-style: solid; border-width: 1px; } XSLT document is a well formed XML document which defines how the transformation of an xml... writing templates in XSLT document.  <?xml version="1.0
Introduction to XSLT
Introduction to XSLT       Extensible Stylesheet Language Transformations (XSLT) is an XML-based language... WML, and XHTML. XSLT is an extension of XSL, which is a stylesheet definition