I have multiple XML with the same schema, let's say:
What I would like to do is merge them into 1 XML document prior to transforming them using ASP and XSL template. Here is my code so far:
I know it has problems, but I have been frustrated with it for quite a while. I believe it isn't too hard to combine them, but how do I get rid of the the doctypes (leaving 1), and then, what will my resulting XML be? I want it to look like this:
Maybe I am missing something?
Code:
<?xml version="1.0" encoding="utf-8"?>
<CDs>
<CD>..</CD>
<CD>..</CD>
<CD>..</CD>
</CDs>
and
<?xml version="1.0" encoding="utf-8"?>
<CDs>
<CD>..</CD>
<CD>..</CD>
<CD>..</CD>
</CDs>
What I would like to do is merge them into 1 XML document prior to transforming them using ASP and XSL template. Here is my code so far:
Code:
Dim objSource
Dim objTarget
Dim objTemplate, objProcessor, strSortField, strGameNumber, objXML, objXSL, strHTML
Set objSource= Server.CreateObject("Msxml2.FreeThreadedDOMDocument.3.0")
Set objTarget= Server.CreateObject("Msxml2.FreeThreadedDOMDocument.3.0")
objSource.async = false
objTarget.async = false
objTarget.loadXML ("<AllCats />")
If objSource.Load(Server.MapPath("LPz_Cat_0 - 9.xml")) Then
For Each objNode In objSource.documentElement.childNodes
objTarget.documentElement.appendChild objNode
Next
End If
If objSource.Load(Server.MapPath("LPz_Cat_A.xml")) Then
For Each objNode In objSource.documentElement.childNodes
objTarget.documentElement.appendChild objNode
Next
End If
Set objXSL = Server.CreateObject("Msxml2.FreeThreadedDOMDocument.3.0")
objXSL.Load Server.MapPath("lpz_all.xsl")
Set objTemplate = Server.CreateObject("MSXML2.XSLTemplate.3.0")
Set objTemplate.stylesheet = objXSL
Set objProcessor = objTemplate.createProcessor
objProcessor.input = objTarget
objProcessor.Transform
strHTML = objProcessor.output
Response.write strHTML
I know it has problems, but I have been frustrated with it for quite a while. I believe it isn't too hard to combine them, but how do I get rid of the the doctypes (leaving 1), and then, what will my resulting XML be? I want it to look like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<CDs>
<CD>..</CD>
<CD>..</CD>
<CD>..</CD>
<CD>Second Set</CD>
<CD>..</CD>
<CD>..</CD>
</CDs>
Maybe I am missing something?