This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XSLT help - urgent Please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT help - urgent Please" Watch "XSLT help - urgent Please" New topic
Author

XSLT help - urgent Please

Maalti Iyer
Ranch Hand

Joined: Jul 11, 2001
Posts: 52
Hi,

I'm new to XSLT. I've an xml document with multiple SalesOrder.
<?xml version="1.0" encoding="UTF-8" ?>
<SalesOrders>
<SalesOrder>
<SalesOrderHeader>
<CustomerInformation>
<CustomerPONumber>34724538</CustomerPONumber>
<SubOrder>
<CostCenter>
<CostCenterNumber>
<![CDATA[ 203260200
]]>
</CostCenterNumber>
<SalesOrderLines>
<SalesOrderLine>
<ItemNumber>
<![CDATA[ 4293
]]>
</ItemNumber>
</SalesOrderLine>
<SalesOrderLine>
<ItemNumber>
<![CDATA[ A83690-2CRL
]]>
</ItemNumber>
</SalesOrderLine>
<SalesOrderLine>
<ItemNumber>
<![CDATA[ N1N411BK
]]>
</ItemNumber>
</SalesOrderLine>
</SalesOrderLines>
</SubOrder>
</SalesOrder>
</SalesOrders>

I need to write a style sheet to generate a report of the following format

CustomerPONumber CostCenterNumber ItemNumber
ItemNumber
ItemNumber
I don't know how to retreive the first occurance of ItemNumber to put it in the first line and rest of the occurances in the following line.

Can someone here help me?

Thanks for your time.
Maalti
Hasan Pasha
Greenhorn

Joined: Feb 23, 2005
Posts: 25
Your XML is not well-formed... Pls. post a well-formed XML.
Maalti Iyer
Ranch Hand

Joined: Jul 11, 2001
Posts: 52
I'm sorry its my bad

Here's the good one

<?xml version="1.0" encoding="UTF-8"?>
<SalesOrders>
<SalesOrder>
<SalesOrderHeader>
<CustomerInformation>
<CustomerPONumber>34724538</CustomerPONumber>
</CustomerInformation>
</SalesOrderHeader>
<SubOrder>
<CostCenter>
<CostCenterNumber>
<![CDATA[ 203260200]]>
</CostCenterNumber>
</CostCenter>
<SalesOrderLines>
<SalesOrderLine>
<ItemNumber> <![CDATA[ 4293]]>
</ItemNumber>
</SalesOrderLine>
<SalesOrderLine>
<ItemNumber><![CDATA[ A83690-2CRL]]>
</ItemNumber>
</SalesOrderLine>
<SalesOrderLine>
<ItemNumber><![CDATA[ N1N411BK]]>
</ItemNumber>
</SalesOrderLine>
</SalesOrderLines>
</SubOrder>
</SalesOrder>
</SalesOrders>


Thanks
Maalti
Vijay Vaddem
Ranch Hand

Joined: Feb 13, 2004
Posts: 243
Well, i have just started working on XSLT.....

Try this
-----------



Vijay
[ March 22, 2005: Message edited by: Vijay Vaddem ]
 
GeeCON Prague 2014
 
subject: XSLT help - urgent Please