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

how can I deal with the xml problems

Subject: [xsl] how can I deal with the xml problems
From: "Wang Ning" <ilydearp@xxxxxxxxxxx>
Date: Sun, 24 Nov 2002 21:45:08 +0000
wang ning







Hello dear firend:

I have a question here ,could you kind enough to give me a quick answer
please? i have 3 xml documents here, first one is
fellowship:
<?xml version="1.0" ?>
- <fellowship id="1000">
  <title>Entertainment Club</title>
  <descr>welcome to this amazing club</descr>
- <members>
- <member id="200201">
  <link url="file:// wangning" />
  </member>
- <member id="200202">
  <link url="file://Derek" />
  </member>
  </members>
  </fellowship>

and the other two have the same structure one is fellow1.xml

<?xml version="1.0" ?>
<fellow>
  <name>Ning</name>
  <surname>Wang</surname>
  <email>ilydear@xxxxxxxxxxx</email>
 <resources>
 <resource id="001" type="mp3">
  <title>Hero</title>
  <author id="Sony">John</author>
  <description>Famous in UK.</description>
  <location url="file://wangning" />
  </resource>
 <resource id="002" type="mp3">
  <title>Titanic</title>
  <author id="BMW">Jane</author>
  <description>Famous in World!.</description>
  <location url="file://wangning" />
  </resource>
  </resources>
  </fellow>

and fellow2.xml

<?xml version="1.0" ?>
- <fellow>
  <name>Derek</name>
  <surname>Ben</surname>
  <email>derek@xxxxxxxxxxx</email>
- <resources>
- <resource id="003" type="ebook">
  <title>Ghost</title>
  <author id="UK">TomJohson</author>
  <description>Written in 1978.</description>
  <location url="file://Derek" />
  </resource>
- <resource id="004" type="ebook">
  <title>Angel</title>
  <author id="USA">Jerry</author>
  <description>very good imagination!.</description>
  <location url="file://Derek" />
  </resource>
  </resources>
  </fellow>

The question here is how I can merge the two documents to a new xml
document according to the following given catalogue.dtd

catalogue.dtd

 <!ELEMENT catalogue (items)>
 <!ATTLIST catalogue id ID #REQUIRED>

<!ELEMENT items (item)*>

<!ELEMENT item (type, title, author*, description, location, owner)>
<!ATTLIST item id ID #REQUIRED>


<!ELEMENT type (#PCDATA)>

<!ELEMENT title (#PCDATA)>

 <!ELEMENT author (#PCDATA)>
 <!ATTLIST author id CDATA #REQUIRED>

<!ELEMENT description (#PCDATA)>

 <!ELEMENT location EMPTY>
 <!ATTLIST location url CDATA #REQUIRED>

 <!ELEMENT owner EMPTY>
 <!ATTLIST owner id CDATA #REQUIRED
                   url CDATA #REQUIRED>

I hope there is a quick and simple way to do it !

Thank you very much!



_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/lccn/



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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-2013 All Rights Reserved.