Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSLT help - urgent Please

 
Maalti Iyer
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your XML is not well-formed... Pls. post a well-formed XML.
 
Maalti Iyer
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, i have just started working on XSLT.....

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



Vijay
[ March 22, 2005: Message edited by: Vijay Vaddem ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic