Jump to content
Sign in to follow this  

Problem with _XMLSelectNodes

Recommended Posts

I am trying to open an xml file, and select some nodes to loop through, so I can pull data from them.  I am getting "No matching nodes found", when I try to pull the <include nodes.


#include <_XMLDomWrapper.au3>
Local $iRET, $iNodeCnt, $sXPath = "/databaseChangeLog"
Local $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "_XMLCOMEerr")


$iRET = _XMLFileOpen("c:\temp\test\test.xml")
If @error Then
    MsgBox(16,"Error",@error & @LF & @extended)

_DebugWrite("sXPath = " & $sXPath)
$tempXPath = $sXPath & "/*"
$aNodes = _XMLSelectNodes($tempXPath)
_DebugWrite("tempXPath = " & $tempXPath)
If @error Then
    MsgBox(16,"Error During SelectNodes",@error)

If IsArray($aNodes) Then
    ConsoleWrite("Check" & @LF)
For $n = 1 To $aNodes[0]
  ConsoleWrite($aNodes[$n] & @LF)

XML File:

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" 
                    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
    <changeSet context="baseline" author="author" id="OracleCharacterSetCheck" dbms="oracle" runAlways="true">
        <preConditions onFail="WARN" onFailMessage="This database is not using a supported character set, and unexpected errors may occur as a result.">
            <sqlCheck expectedResult="1">SELECT count(*) FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET' and value in ('WE8ISO8859P15', 'WE8MSWIN1252', 'WE8ISO8859P1');</sqlCheck>
    <include file="releaseChangelogs/version1/baseline.xml" relativeToChangelogFile="true"/>
    <include file="releaseChangelogs/version2/file.xml" relativeToChangelogFile="true"/>
    <include file="releaseChangelogs/version3/file.xml" relativeToChangelogFile="true"/>
    <include file="releaseChangelogs/version4/file.xml" relativeToChangelogFile="true"/>


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...