BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


XML DOM
How to use InsertAfter() with XmlDocument?
How to remove xml elements using RemoveChild() with XmlDocument?
How to select specific nodes in XmlDocument() when having a namespace ?
How to Load a XML From a String with XmlDocument?
How to remove an attribute with XmlDocument and RemoveAll?
How to create a navigator with XmlDocument and CreateNavigator?
Whats the 'push model'?
Hybrid Model Part Two: Choosing between SAX and DOM


 
 

<< XHTMLXmlSerializer >>


By David Silverlight
First Posted 05/24/2003
Times viewed 2147

Combining XML Documents using XSLT - a collection of 5 approaches


This post contains attachments
v20030524142328.zip 

Summary This snippet contains a collection of 5 distinct approaches to combining multiple XML Documents into a single XML document. The original article is also included as part of this snippet.

The following collection of approaches to combining XML Documents is from a column, Shedding a little Silverlight on XML, that I wrote for XML Journal a while back.

The PDF Version of the article is included with this snippet:

Example 1: By JenniTennison - Creating a reference to a parsed entity in your XML Document
File Description
JeniCombineA.xml XML file that will create the combination of the multiple files.
AllProducts.xsl XSLT Stylesheet used to transform the contents of the JeniCombineA.xml.
JeniCombineAOutput.htm Example of the HTML output that will result from transforming JeniCombineA.xml with AllProducts.xsl.
DisplayProds.xsl Template that will be used to display a set of product elements as an HTML Table.
ProductSalesNW.xml XML Data file containing products from the Northwest region.
ProductSalesSW.xml XML Data file containing products from the Southwest region.


Example 2: By Jenni Tennison - In this example, the name of the XML document is stored as an atttribute value. The document() function is used in the stylesheet to create an instance of each XML Document.
File Description
JeniDataB.xml XML file containing the filenames of the documents to be combined.
JeniCombineB.xsl XSLT Stylesheet used to combine the documents whose filenames are in JeniDataB.xml
JeniCombineBOutput.xml Example of the XML output that will result from transforming JeniCombineB.xml with AllProducts.xsl
ProductSalesNW.xml XML Data file containing products from the Northwest region
ProductSalesSW.xml XML Data file containing products from the Southwest region.

Example 3: By Ken Holman - Creating a reference to an Unparsed Entity in your XML Documents.
File Description
AllProductsMain.xml XML document which will generate the combined xml files
AllProducts.xsl XSLT Stylesheet used to transform the combined xml files
AllProductsOutput.htm Example of the HTML output that will result from transforming AllProductsMain.xml with AllProducts.xsl
ProductSalesNW.xml XML Data file containing products from the Northwest region
ProductSalesSW.xml XML Data file containing products from the Southwest region..


Example 4: By Kurt Cagle - This example shows how we can use the document function with multiple nodes.  Note how we can apply an XPath query to our variable, which holds the XML document names.
File Description
KurtData.xml XML file which contains the names of the xml files to be combined
KurtCombine.xsl XML document which will combine transform the filenames contained in KurtData.xml
KurtDataOutput.htm Example of the HTML output that will result from transforming KurtData.xml with KurtCombine.xsl
DisplayProds.xsl Template that will be used to display a set of product elements as an HTML Table.
ProductSalesNW.xml XML Data file containing products from the Northwest region.
ProductSalesSW.xml XML Data file containing products from the Southwest region.


Example 5: by Trace Wilson - This code snippet uses a combination of the XML DOM and ASP to merge the documents together.
File Description
AllProducts.xml XML Document which contains the root element that all of the xml files will be appended to
AllProducts.xsl XSLT Stylesheet used to transform the combination of xml files
CombiningXML.aspASP file which will merge the xml documents together.
ProductSalesNW.xml XML Data file containing products from the Northwest region.
ProductSalesSW.xmlXML Data file containing products from the Southwest region.



Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< XHTMLXmlSerializer >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML