|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Merging multiple xmls into a single xml
(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?
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








