[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re-arranging an XML file

Subject: Re-arranging an XML file
From: "Mike Stroud" <stroudmw@xxxxxxxxx>
Date: Tue, 13 Jan 2009 15:24:50 +0200
 Re-arranging an XML file
Hello from a newbie to this list!

I am new to XSL and have a query that I hope someone will help me with.

I have an XML file that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Catalog>
  <cds>
    <cd>
      <number>000001</number>
      <title>Empire Burlesque</title>
    </cd>
    <cd>
      <number>000002</number>
      <title>Hide Your Heart</title>
    </cd>
  </cds>
  <artists>
    <artist>
      <number>000001</number>
      <name>Bob Dylan</name>
    </artist>
    <artist>
      <number>000002</number>
      <name>Bonnie Tyler</name>
    </artist>
  </artists>
 </Catalog>

Is there an easy way for an XSL rookie to transform  it to look more like this?

<?xml version="1.0" encoding="UTF-8"?>
 <Catalog>
   <cd>
     <title>Empire Burlesque</title>
     <artist>Bob Dylan</artist>
    </cd>
    <cd>
      <title>Hide Your Heart</title>
    <artist>Bonnie Tyler></artist>
  </cd>
</Catalog>

I realise that I'll have to link cd/number 000001 with artist/number
000001, but I have no idea how to go about it.

Many thanks,

Mike in SA

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.