Groups | Blog | Home
all groups > dotnet xml > may 2004 >

dotnet xml : Need help merging documents



Robert Strickland
5/21/2004 4:08:48 PM
I need to merge 3 or more xml streams (I have 4 string variables that
contain xml) into a single xml stream before doing a transformation. Is
there any sample code or site to show the way?

Thanks

Yan Leshinsky
5/21/2004 5:12:14 PM
Input to XSLT cannot realy be a stream (in the general case). Meaning that
XSLT processing cannot be implemented in the forward only fassion. You can
adderss each document through document($uri) function.
If you want to merge them into one node-set:
<xsl:variable name="docs">
<doc>a.xml</doc>
<doc>b.xml</doc>
<doc>c.xml</doc>
</xsl:variable>

<xsl:template match="/">
<root>
<xsl:copy-of select="document(msxsl:node-set($docs)/doc)"/>
</root>
</xsl:template>



[quoted text, click to view]

v-kevy NO[at]SPAM online.microsoft.com
5/22/2004 1:34:03 AM
Thanks for Yan's quick response!

Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to merge several Xml strings.
If there is any misunderstanding, please feel free to let me know.

Besides using XSL, you can also use classes in .NET framework and MSXML to
achieve this. Here I have found some KB articles about doing so.

http://support.microsoft.com/default.aspx?scid=kb;en-us;311530
http://support.microsoft.com/default.aspx?scid=kb;en-us;286817

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Robert Strickland
5/23/2004 11:50:03 AM
Thanks

[quoted text, click to view]

AddThis Social Bookmark Button