0

hi,

I have a problem with the below code. It gives error Public member 'resolveExternal' on type 'DOMDocumentClass' not found. at the palce i mark in green. Please help me to solve this.....

Public Sub ReadIndXML(ByVal LoopID As Integer)

        Dim strXMLPath As String '= ""
        Dim xmlRoot As MSXML.IXMLDOMElement
        Dim objDOMXML As New MSXML.DOMDocument
        Dim intNodesLength As Short
        Dim i As Integer = 0
        'Dim strOutput As String = ""

        strXMLPath = CurDir() & "\Config\MainConfig.xml"

        objDOMXML.resolveExternal = True
        objDOMXML.validateOnParse = True
        objDOMXML.async = False
        Call objDOMXML.load(strXMLPath)

        xmlRoot = objDOMXML.documentElement
        If xmlRoot.baseName = "Configuration" Then
            If xmlRoot.childNodes.item(LoopID).hasChildNodes = True Then
                intNodesLength = xmlRoot.childNodes.item(LoopID).childNodes.length
                xmlRoot = xmlRoot.childNodes.item(LoopID).firstChild
                For i = 0 To intNodesLength - 1
                    If xmlRoot.attributes.item(0).text = "Assets" Then
                        XmlAssetsPath = xmlRoot.text
                    ElseIf xmlRoot.attributes.item(0).text = "PrimaryLanguage" Then
                        XmlPrimaryLanguage = xmlRoot.text
                    End If

                    xmlRoot = xmlRoot.nextSibling
                Next i
            End If
        End If
        objDOMXML.abort()

    End Sub
2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by __avd
0

Don't use resolveExternal when xml document is constructed without exernal/internal DTD. Please post XML document here.

0

hi,

this is contents of my xml....Please help.TQ

<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Key Name="General">
    <Value Name="Assets">C:\Program Files\abc\Assets</Value>
    <Value Name="config">C:\Program Files\abc\config</Value>
    <Value Name="PrimaryLanguage">English</Value>
       </Key>
</Configuration>
0

Sorry! but the same code is running perfectly. (MSXML 2.0, MSXML2.6, 3.0 and other com lib). Try the .net framework System.XML API instead of COM.

0

hi,

do you have the sample's or else can you modify on my given source code...TQ

0
Imports System.Xml.Linq
Imports System.Xml

Public Class Sample
    Private Sub ReadData()
        Dim strXMLPath As String = "c:\path\config.xml"
        Dim doc As XDocument = XDocument.Load(strXMLPath)
        Dim path, lang As String
        For Each var In doc.Descendants("Value")
            If var.HasAttributes Then
                Select Case var.Attribute("Name").Value
                    Case "Assets"
                        path = var.Value
                    Case "PrimaryLanguage"
                        lang = var.Value
                End Select
            End If
        Next
    End Sub
End Class
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.