J
Jacinle Young
Hi,
I need to merge XML from different sources to 1 XML file.
I am wondering if XSLT could do this job as usually it is used to perform
1 to 1 file transfrom
eg.
src1.xml
<?xml version="1.0" encoding="UTF-8"?>
<nickname>Fred</nickname>
<email>[email protected]</email>
<html>TRUE</html>
<firstname>Fred</firstname>
<lastname>Flintstone</lastname>
src2.xml
<?xml version="1.0" encoding="UTF-8"?>
<nickname>Fred</nickname>
<work>999-Quarry</work>
<home>999-BedrockLane</home>
<fax>888-Squawk</fax>
<pager>777-pager</pager>
<cell>555-cell</cell>
result.xml
<?xml version="1.0" encoding="UTF-8"?>
<addressbook>
<nickname>Fred</nickname>
<email>[email protected]</email>
<html>TRUE</html>
<firstname>Fred</firstname>
<lastname>Flintstone</lastname>
<work>999-Quarry</work>
<home>999-BedrockLane</home>
<fax>888-Squawk</fax>
<pager>777-pager</pager>
<cell>555-cell</cell>
</addressbook>
Jacinle
I need to merge XML from different sources to 1 XML file.
I am wondering if XSLT could do this job as usually it is used to perform
1 to 1 file transfrom
eg.
src1.xml
<?xml version="1.0" encoding="UTF-8"?>
<nickname>Fred</nickname>
<email>[email protected]</email>
<html>TRUE</html>
<firstname>Fred</firstname>
<lastname>Flintstone</lastname>
src2.xml
<?xml version="1.0" encoding="UTF-8"?>
<nickname>Fred</nickname>
<work>999-Quarry</work>
<home>999-BedrockLane</home>
<fax>888-Squawk</fax>
<pager>777-pager</pager>
<cell>555-cell</cell>
result.xml
<?xml version="1.0" encoding="UTF-8"?>
<addressbook>
<nickname>Fred</nickname>
<email>[email protected]</email>
<html>TRUE</html>
<firstname>Fred</firstname>
<lastname>Flintstone</lastname>
<work>999-Quarry</work>
<home>999-BedrockLane</home>
<fax>888-Squawk</fax>
<pager>777-pager</pager>
<cell>555-cell</cell>
</addressbook>
Jacinle