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

Re: Merging multiple xmls into a single xml

Subject: Re: Merging multiple xmls into a single xml
From: iwantto keepanon <iwanttokeepanon@xxxxxxxx>
Date: Fri, 22 Jul 2005 22:24:09 +0400 (MSD)
merge xml files bash
(I think I sent this from a non-subscribed email address, so I am resending ... never saw it come into 
the list)


"Neelam Joshi" <mneelam@xxxxxxxxx> writes:

> I want to merge multiple xmls into a single xml. Here are the details:


See Example 1 "parsed entities" @ http://www.topxml.com/code/default.asp?
p=3&id=v20030524142328&ms=20&l=xslt&sw=All

Basically this is your XML:
   <?xml version="1.0" encoding="utf-8"?>
   <!DOCTYPE allproducts [
      <!ENTITY resourceA SYSTEM "ProductSalesSW.xml">
      <!ENTITY resourceB SYSTEM "ProductSalesNW.xml">
   ]>
   <allproducts>
      &resourceA;
      &resourceB;
   </allproducts>

And this could be your XSLT:
   <?xml version='1.0' encoding='utf-8' ?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
   <xsl:output method="xml" indent="yes"/>

   <xsl:template match="/">
      <xsl:apply-templates />
   </xsl:template>

   <xsl:template match="allproducts">
      <xsl:element name="products" >
         <xsl:copy-of select="." />
      </xsl:element>
   </xsl:template>

   </xsl:stylesheet>

(full listings, discussion, and XML input files at URL.)

You could write a small quick CGI (bash, perl, anything) to generate
the XML file based on files/directories.  Then the XSLT script would
take it from there w/o document() function calls.

My question to the list is, why hasnt this been offered as a solution
to several recent queries like "how do i combine .... ?".  Is this a
good solution?

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.