473,387 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to form xslt for following output using key?

Input xml:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Order>
  3.     <OrderLines>
  4.         <OrderLine ChangeInOrderedQty="1">
  5.             <Item ItemID="Item_1"/>
  6.             <Extn ExtnLineNumber="1"/>
  7.             <StatusBreakupForCanceledQty>
  8.                 <CanceledFrom OrderReleaseKey="1111" Status="cancel">
  9.                     <Details ShipNode="150"/>
  10.                 </CanceledFrom>
  11.             </StatusBreakupForCanceledQty>
  12.         </OrderLine>
  13.     </OrderLines>
  14.     <OrderLines>
  15.         <OrderLine ChangeInOrderedQty="4">
  16.             <Item ItemID="Item_2"/>
  17.             <Extn ExtnLineNumber="2"/>
  18.             <StatusBreakupForCanceledQty>
  19.                 <CanceledFrom OrderReleaseKey="1121" Status="cancel">
  20.                     <Details ShipNode="150"/>
  21.                 </CanceledFrom>
  22.             </StatusBreakupForCanceledQty>
  23.         </OrderLine>
  24.     </OrderLines>
  25.     <OrderLines>
  26.         <OrderLine ChangeInOrderedQty="6">
  27.             <Item ItemID="Item_3"/>
  28.             <Extn ExtnLineNumber="3"/>
  29.             <StatusBreakupForCanceledQty>
  30.                 <CanceledFrom OrderReleaseKey="1111" Status="cancel">
  31.                     <Details ShipNode="150"/>
  32.                 </CanceledFrom>
  33.             </StatusBreakupForCanceledQty>
  34.         </OrderLine>
  35.     </OrderLines>
  36.     <OrderLines>
  37.         <OrderLine ChangeInOrderedQty="2">
  38.             <Item ItemID="Item_5"/>
  39.             <Extn ExtnLineNumber="4"/>
  40.             <StatusBreakupForCanceledQty>
  41.                 <CanceledFrom OrderReleaseKey="1111" Status="cancel">
  42.                     <Details ShipNode="100"/>
  43.                 </CanceledFrom>
  44.             </StatusBreakupForCanceledQty>
  45.         </OrderLine>
  46.         <OrderLines>
  47.             <OrderLine ChangeInOrderedQty="3">
  48.                 <Item ItemID="Item_5"/>
  49.                 <Extn ExtnLineNumber="5"/>
  50.                 <StatusBreakupForCanceledQty>
  51.                     <CanceledFrom OrderReleaseKey="1121" Status="cancel">
  52.                         <Details ShipNode="150"/>
  53.                     </CanceledFrom>
  54.                 </StatusBreakupForCanceledQty>
  55.             </OrderLine>
  56.             <OrderLine ChangeInOrderedQty="4">
  57.                 <Item ItemID="Item_5"/>
  58.                 <Extn ExtnLineNumber="6"/>
  59.                 <StatusBreakupForCanceledQty>
  60.                     <CanceledFrom OrderReleaseKey="1121" Status="cancel">
  61.                         <Details ShipNode="100"/>
  62.                     </CanceledFrom>
  63.                 </StatusBreakupForCanceledQty>
  64.             </OrderLine>
  65.         </OrderLines>
  66.     </OrderLines>
  67. </Order>

Output xml:
Need to group orderlines based orderReleaseKey and ship node should be 150.


Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <OrderReleaseList>
  3.     <OrderReleaseDetail OrderReleaseKey="1111">
  4.         <OrderLines>
  5.             <OrderLine ChangeInOrderedQty="1">
  6.                 <Item ItemID="Item_1" />
  7.                 <Extn ExtnLineNumber="1" />
  8.             </OrderLine>
  9.         </OrderLines>
  10.         <OrderLines>
  11.             <OrderLine ChangeInOrderedQty="6">
  12.                 <Item ItemID="Item_3" />
  13.                 <Extn ExtnLineNumber="3" />
  14.             </OrderLine>
  15.         </OrderLines>
  16.       <OrderReleaseDetail>
  17.    <OrderReleaseDetail OrderReleaseKey="1121">
  18.     <OrderLines>
  19.             <OrderLine ChangeInOrderedQty="3">
  20.                 <Item ItemID="Item_5" />
  21.                 <Extn ExtnLineNumber="5" />
  22.             </OrderLine>
  23.         </OrderLines>
  24. </OrderReleaseList>
Nov 26 '10 #1
1 1402
jkmyoung
2,057 Expert 2GB
See Muenchian grouping:
http://www.jenitennison.com/xslt/gro...muenchian.html

Your filter on your nodes should be in your key and for-each.
Nov 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Waqas Ashraf | last post by:
hi, I am a newbie at xml/xsl. I m trying to generate a book of papers marked up in xml. I have a simple xml file which includes the papers, and i have xsl stylesheet document which generates the...
1
by: Lisa | last post by:
I need to apply the HTML formatting tags and the French accented characters in a XML document. The XML is generated from a database that has HTML tags and French accented characters in the records....
3
by: Michael Ahlers | last post by:
Obviously if you're looping or using a template, choosing output based on the current iteration is easy. For example, if you're walking a set of elements and you want index % 2 == 0 produce one...
0
by: thomas | last post by:
This problem has been bothering me for a couple of days now. I'm trying to get a small xml based search engine to output 20 results on one page then 20 on the next page when you click a link and so...
3
by: Grant Harmeyer | last post by:
Ok: I have done small level Xml stuff and am just now starting to understand some of the plumbing involved. I've done a lot of .NET programming for SQL Server, but little for Xml data stores. ...
6
by: tony | last post by:
Hello! When exactly is it important or advisable to use this form load event handler compare to using the C-tor. For example here I create an event handler called dataBoundGridForm that is...
4
by: sandhya2006 | last post by:
Dear Friends, I have a doubt in how to dispaly the original form of a verb using java.ie if the word is arose then the output must be arise.but now in my program there is one text...
2
by: Jonny B | last post by:
Hi all, I'm working on an a clientside xslt using jscript that passes a parameter to the xsl. I've got it working no problem in IE but cant get it to work in Mozilla. Can anyone help? This is...
1
by: itssri.srinivas | last post by:
Hi, Below is the XSL syntax to filter output from XML file based on single value:- <xsl:for-each select="catalog/cd"> so, above code displays the text of the CD elements whose artist is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.