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

Merging two xml files

Subject: Merging two xml files
From: Mulberry Technologies List Owner<xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 25 Aug 2003 11:20:19 -0400
merge two xml
>From: Patrick Martin <patrick.martin@xxxxxxxxxxx>
>To: "'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'" <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
>Subject: Merging two xml files
>Date: Mon, 25 Aug 2003 12:04:23 +0200
>
>Hi,
>
>I am trying to merge two xml files, using a xsl stylesheet. Those files are
>actually BEA Weblogic's configuration files (config.xml and a partial
>config.xml), but I'd like the xsl script to be quite generic (avoid
>hardcoding the element names and attributes).
>
>Basically, the only thing I know about the files is that they have the same
>root node.
>
>For example, with the 2 following files:
>File1.xml:
><root>
>	<elt1 att1="a" att2="b">
>		<subelt1 att1="b"/>
>		<subelt1 att1="c"/>
>	</elt1>
>	<elt2 att1="d"/>
></root>
>
>File2.xml:
><root>
>	<elt1 att1="a" att2="b">
>		<subelt1 att1="c"/>
>		<subelt1 att1="d"/>
>	</elt1>
>	<elt1 att1="a" att2="d">
>		<subelt1 att1="x"/>
>	</elt1>
>	<elt3 att1="e"/>
></root>
>
>Should give something like:
><root>
>	<elt1 att1="a" att2="b">
>		<subelt1 att1="b"/>
>		<subelt1 att1="c"/>
>		<subelt1 att1="d"/>
>	</elt1>
>	<elt1 att1="a" att2="d">
>		<subelt1 att1="x"/>
>	</elt1>
>	<elt2 att1="d"/>
>	<elt3 att1="e"/>
></root>
>
>So the following rules must be respected:
>. Each element associated with its attribute is unique (we don't have two
><elt1 att1="a" att2="b">).
>. If one element exists only in one of the file, it should  appear in the
>output.
>
>I am very new to xsl and tried to look on the web without finding exactly
>what I want.
>
>Does anyone have an idea on how to solve that question?
>
>Thank you,
>
>Patrick
>
>
>
>
>Confidentiality Notice: The information contained in this e-mail message is
>intended only for the personal and confidential use of the recipient(s)
>named above. If the reader of this message is not the intended recipient or
>an agent responsible for delivering it to the intended recipient, you are
>hereby notified that you have received this document in error and that any
>review, dissemination, distribution, or copying of this message is strictly
>prohibited. If you have received this communication in error, please notify
>us immediately by e-mail, and delete the original message.
>
>Message confidentiel : Les informations contenues dans ce message sont
>destinees a un usage personnel et confidentiel du destinataire indique
>ci-dessus. Si le lecteur de ce message n'est pas le destinataire prevu, ou
>n'est pas une personne en charge de le delivrer au destinataire voulu, vous
>etes par la presente informe que vous avez recu ce document par erreur, et
>que tout examen, transmission, distribution ou copie de ce message est
>totalement interdit. Si vous avez recu cette communication par erreur, nous
>vous remercions de bien vouloir nous avertir immediatement par e-mail et de
>detruire le message d'origine.



 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.