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(_at_)hotmail(_dot_)com</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(_at_)hotmail(_dot_)com</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