SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: VB/XML Problems

  1. #1
    SitePoint Member
    Join Date
    Jun 2003
    Location
    OAKMONT
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation VB/XML Problems

    Hello...

    I have been trying to figure this problem out for days:

    --------------------------------------------------------------
    SNIPPET
    --------------------------------------------------------------
    m_strXmlPath = App.Path & "\AUG2003.xml"

    'parse XML
    Call m_objDOMDays.Load(m_stringXMLPath)

    '******START FUNCTION'******
    Private Sub populateDayDetails(objSelNode As Node)

    Dim objDayElement As IXMLDOMElement
    Dim test As IXMLDOMElement

    Dim strAttName As String
    Dim objChildElement As IXMLDOMElement

    If objSelNode Is Nothing Then Exit Sub


    'if user clicks on any other node than the day node, ignore
    If objSelNode.Tag <> "" Then

    '****************************************
    'The PROBLEM IS HERE
    '****************************************
    --> Set objDayElement = m_objDOMDays.nodeFromID(objSelNode.Tag)
    '****************************************
    For Each objChildElement In objDayElement.childNodes
    MsgBox objDayElement.baseName

    Next

    End If

    End Sub
    --------------------------------------------------------------
    END SNIPPET
    --------------------------------------------------------------

    The objSelNode.tag = 'n' where n = an attribute say, 1,2,3 which is a day number.

    See XML snippet BELOW
    --------------------------------------------------------------
    SNIPPET
    --------------------------------------------------------------
    <?xml version="1.0"?>

    <month name="Aug">

    <day number='1'>
    <weekday>Friday</weekday>
    <weekdate>1</weekdate>
    <event></event>
    <eventTime></eventTime>
    </day>

    </month>
    --------------------------------------------------------------
    END SNIPPET
    --------------------------------------------------------------

    The file is parsing in ok, it's just when I try to set the objDayElement equal to the m_objDOMDays.nodeFromID() object [Set objDayElement = m_objDOMDays.nodeFromID(objSelNode.Tag)] that I get the problem.

    Thanks!

    Doug Dexter

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2000
    Location
    Chico, Ca
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know if you have tried this, but try posting this on asp.net

    They may have an answer.

    Chuck
    "Happiness doesn't find you, you find happiness" -- Unknown
    www.chuckknows.com

  3. #3
    SitePoint Member pgirl's Avatar
    Join Date
    Jun 2003
    Location
    New Zealand
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    m_strXmlPath = App.Path & "\AUG2003.xml"

    'parse XML
    Call m_objDOMDays.Load(m_stringXMLPath)


    Have you noticed that the file path you pass in as an argument is different to the file you inititalise the line above?

    Line 1 m_strXmlPath
    Line 2 m_stringXMLPath


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •