Hi
I am an XML newbe and I have this MSXML 4.0 compatibility problem... My code runs on MSXML 2.5 and 3.0 OK but when I use MSXML 4.0 it stop working (no ASP errors!)
OK what I am doing I am comparaing 2 XML files that represent directory and file structure on 2 boxes and reporting any problems
This is my ASP code:
****************************************************
****************************************************
and this is my fromXML:
****************************************************
********************************************************
and this is my ToXml:
***************************************************
when I run it with 4.0 it can't find any matches in first directory <dir name="order"> and all child elemnts in this element but works fine for other dir: <dir name=""> and all child elements
I know this is big chunk of code and it must be hard to see what's wrong here but I really need to get this code working on 4.0... Any help will be greatly appreciated.
Thank you
Sergei
I am an XML newbe and I have this MSXML 4.0 compatibility problem... My code runs on MSXML 2.5 and 3.0 OK but when I use MSXML 4.0 it stop working (no ASP errors!)
OK what I am doing I am comparaing 2 XML files that represent directory and file structure on 2 boxes and reporting any problems
This is my ASP code:
****************************************************
Code:
Set objRootElement = objXMLFrom.documentElement
For i = 0 To objRootElement.childNodes.length - 1
'get current dir details
strDirName = Replace(objRootElement.childNodes.item(i).getAttribute("name"), "\", "\\")
'find it in other XML document
Set currentDir = objXMLTo.documentElement.selectSingleNode("//dir[@name='" & strDirName & "']")
If(currentDir Is Nothing) Then
strErrorsList = AddComparisonError(CONST_MISSING_DIR)
End if
'go over files in current direcotry
For j = 0 To objRootElement.childNodes.item(i).childNodes.length - 1
'get current file details
strFileName = Replace(objRootElement.childNodes.item(i).childNodes.item(j).getAttribute("name"), "\","\\")
strFileSize = objRootElement.childNodes.item(i).childNodes.item(j).getAttribute("size")
strSccInfo = objRootElement.childNodes.item(i).childNodes.item(j).getAttribute("scc")
'find it in other XML document
Set currnetFile =objXMLTo.documentElement.selectSingleNode("//dir[@name='" & strDirName & "']" & "/file[@name='" & strFileName & "']")
If(currnetFile Is Nothing) Then
strErrorsList = AddComparisonError(CONST_MISSING_FILE)
Else
if(CDbl(currnetFile.attributes(1).nodeValue) <> CDbl(strFileSize) OR currnetFile.attributes(2).nodeValue <> strSccInfo) Then
strErrorsList = AddComparisonError(CONST_WRONG_SCC_INFO)
End If
End If
Next
Next
and this is my fromXML:
****************************************************
Code:
- <sourceCode machine="W000802ACBBE3" path="c:\sites\anzgold\[URL unfurl="true"]wwwroot\reader\"[/URL] date="30/06/2003 10:37">
- <dir name="order">
<file name="order\index.cfm" size="3297" scc="$Modtime: 6/05/03 3:43p $" />
<file name="order\orderAgreementAdditional.cfm" size="3219" scc="$Modtime: 11/02/03 4:48p $" />
<file name="order\orderConfirmation.cfm" size="2542" scc="$Modtime: 11/02/03 4:49p $" />
<file name="order\orderConfirmationAdditional.cfm" size="4232" scc="$Modtime: 11/02/03 4:49p $" />
<file name="order\printPopupAdditional.cfm" size="3318" scc="$Modtime: 11/02/03 4:49p $" />
<file name="order\readerPopup.cfm" size="689" scc="$Modtime: 6/05/03 3:43p $" />
<file name="order\termsAndConditionsPopup.cfm" size="847" scc="$Modtime: 31/03/03 10:10a $" />
</dir>
- <dir name="">
<file name="index.cfm" size="3253" scc="$Modtime: 6/05/03 3:42p $" />
<file name="install.cfm" size="2925" scc="$Modtime: 21/03/03 12:27p $" />
<file name="installPopup.cfm" size="10558" scc="$Modtime: 18/03/03 8:56a $" />
<file name="types.cfm" size="692" scc="$Modtime: 21/03/03 3:23p $" />
<file name="use.cfm" size="3586" scc="$Modtime: 13/03/03 3:26p $" />
</dir>
</sourceCode>
and this is my ToXml:
Code:
- <sourceCode machine="W000802ACBBE3" path="c:\sites\anzfirst\[URL unfurl="true"]wwwroot\reader\"[/URL] date="30/06/2003 10:37">
- <dir name="order">
<file name="order\index.cfm" size="3298" scc="$Modtime: 6/05/03 12:03p $" />
<file name="order\orderAgreementAdditional.cfm" size="3222" scc="$Modtime: 11/02/03 2:25p $" />
<file name="order\orderConfirmation.cfm" size="2537" scc="$Modtime: 11/02/03 2:25p $" />
<file name="order\orderConfirmationAdditional.cfm" size="4204" scc="$Modtime: 11/02/03 2:26p $" />
<file name="order\printPopupAdditional.cfm" size="3319" scc="$Modtime: 11/02/03 2:26p $" />
<file name="order\readerPopup.cfm" size="690" scc="$Modtime: 6/05/03 12:03p $" />
<file name="order\termsAndConditionsPopup.cfm" size="847" scc="$Modtime: 31/03/03 10:10a $" />
</dir>
- <dir name="">
<file name="index.cfm" size="3150" scc="$Modtime: 6/05/03 12:02p $" />
<file name="install.cfm" size="2925" scc="$Modtime: 21/03/03 12:27p $" />
<file name="installPopup.cfm" size="10558" scc="$Modtime: 18/03/03 8:51a $" />
<file name="types.cfm" size="693" scc="$Modtime: 21/03/03 3:03p $" />
<file name="use.cfm" size="3587" scc="$Modtime: 13/03/03 3:26p $" />
</dir>
</sourceCode>
when I run it with 4.0 it can't find any matches in first directory <dir name="order"> and all child elemnts in this element but works fine for other dir: <dir name=""> and all child elements
I know this is big chunk of code and it must be hard to see what's wrong here but I really need to get this code working on 4.0... Any help will be greatly appreciated.
Thank you
Sergei