We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,183 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Converting xml document to xml using xslt

Hi there,
I'm new to this web site and new to xml and xslt.
I have the following document that I would like to transform using xml:

<?xml version="1.0" encoding="iso-8859-1" ?>
- <Report Name="Conway">
- <table1>
- <table1_JobNumber_Collection>
- <table1_JobNumber JobNumber="3401">
- <Detail_Collection>
  <Detail ItemNumber="10" ItemSorCode="H0101" ItemSorName="Take up 305mm x 200mm granite kerb, re-square ends as necessary and stack for re-use. Break out 150mm thick concrete foundation and concrete haunch. Load and cart waste to tip." job_item_quantity="2.00" ItemWidth="0.00" ItemLEngth="2.00" ItemDepth="0.00" />
  <Detail ItemNumber="10" ItemSorCode="H0101" ItemSorName="Take up 305mm x 200mm granite kerb, re-square ends as necessary and stack for re-use. Break out 150mm thick concrete foundation and concrete haunch. Load and cart waste to tip." job_item_quantity="2.00" ItemWidth="0.00" ItemLEngth="2.00" ItemDepth="0.00" />
  <Detail ItemNumber="10" ItemSorCode="H0101" ItemSorName="Take up 305mm x 200mm granite kerb, re-square ends as necessary and stack for re-use. Break out 150mm thick concrete foundation and concrete haunch. Load and cart waste to tip." job_item_quantity="2.00" ItemWidth="0.00" ItemLEngth="2.00" ItemDepth="0.00" />
  <Detail ItemNumber="20" ItemSorCode="H0104" ItemSorName="Lay 305mm x 200mm granite kerb to Clause 1109.1AR with 150mm thick, grade C7.5P (ST1) concrete foundation and grade C7.5P (ST1) concrete haunch. Include laying to radius, angled or dropped kerbs with flush or 20mm kerb face." job_item_quantity="2.00" ItemWidth="0.00" ItemLEngth="2.00" ItemDepth="0.00" />
  <Detail ItemNumber="20" ItemSorCode="H0104" ItemSorName="Lay 305mm x 200mm granite kerb to Clause 1109.1AR with 150mm thick, grade C7.5P (ST1) concrete foundation and grade C7.5P (ST1) concrete haunch. Include laying to radius, angled or dropped kerbs with flush or 20mm kerb face." job_item_quantity="2.00" ItemWidth="0.00" ItemLEngth="2.00" ItemDepth="0.00" />
  <Detail ItemNumber="20" ItemSorCode="H0104" ItemSorName="Lay 305mm x 200mm granite kerb to Clause 1109.1AR with 150mm thick, grade C7.5P (ST1) concrete foundation and grade C7.5P (ST1) concrete haunch. Include laying to radius, angled or dropped kerbs with flush or 20mm kerb face." job_item_quantity="2.00" ItemWidth="0.00" ItemLEngth="2.00" ItemDepth="0.00" />
  </Detail_Collection>
  </table1_JobNumber>

I would like the resulting document to look like this

<JobFile>
<JobDetails>
<JobNumber>90903</JobNumber>
<ItemDetails>
<ItemNumber>10</ItemNumber>
<ItemSorCode>CY00478</ItemSorCode>
<ItemSorName>Provide necessary resources to site, in order to carry out welding and metal work repairs to fire barriers.</ItemSorName>
<ItemQuantity>1.00</ItemQuantity>
<ItemWidth>0</ItemWidth>
<ItemLength>0</ItemLength>
<ItemDepth>0</ItemDepth>
</ItemDetails>
</JobDetails>
</JobFile>

where <table1_JobNumber JobNumber> = <JobNumber>

<Detail_Collection> = <ItemDetails>

<Detail

ItemNumber = ItemNumber

ItemSorCode = ItemSorCode

ItemSorName = ItemSorName

job_item_quantity = ItemQuantity

ItemWidth = ItemWidth

ItemLEngth = ItemLength

ItemDepth = ItemDepth >

1
Contributor
0
Replies
1
View
pisces113
Newbie Poster
1 post since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.5067 seconds using 2.7MB