Results 1 to 14 of 14

Thread: [RESOLVED] how to populate listview with this file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2019
    Posts
    194

    Resolved [RESOLVED] how to populate listview with this file

    download .dat file https://gofile.io/?c=Kkmfu1
    open with notepad ++ for better view

    for Each

    Code:
    <game name="005">
    		<description>005</description>
    		<year>1981</year>
    		<manufacturer>Sega</manufacturer>
    		<rom name="1346b.u25" size="2048" crc="8e68533e"/>
    		<rom name="5092.u1" size="2048" crc="29e10a81"/>
    		<rom name="5093.u2" size="2048" crc="e1edc3df"/>
    		<rom name="5094.u3" size="2048" crc="995773bb"/>
    		<rom name="5095.u4" size="2048" crc="f887f575"/>
    		<rom name="5096.u5" size="2048" crc="5545241e"/>
    		<rom name="5097.u6" size="2048" crc="428edb54"/>
    		<rom name="5098.u7" size="2048" crc="5bcb9d63"/>
    		<rom name="5099.u8" size="2048" crc="0ea24ba3"/>
    		<rom name="5100.u9" size="2048" crc="a79af131"/>
    		<rom name="5101.u10" size="2048" crc="8a1cdae0"/>
    		<rom name="5102.u11" size="2048" crc="70826a15"/>
    		<rom name="5103.u12" size="2048" crc="7f80c5b0"/>
    		<rom name="5104.u13" size="2048" crc="0140930e"/>
    		<rom name="5105.u14" size="2048" crc="17807a05"/>
    		<rom name="5106.u15" size="2048" crc="c7cdfa9d"/>
    		<rom name="5107.u16" size="2048" crc="95f8a2e6"/>
    		<rom name="5108.u17" size="2048" crc="d371cacd"/>
    		<rom name="5109.u18" size="2048" crc="48a20617"/>
    		<rom name="5110.u19" size="2048" crc="7d26111a"/>
    		<rom name="5111.u20" size="2048" crc="a888e175"/>
    		<rom name="epr-1286.16" size="2048" crc="fbe0d501"/>
    	</game>
    need the title 005
    <rom name="5092.u1" these 5092.u1

    Code:
    Private Sub Command5_Click()
    Dim i As Integer
    Set Me.TreeView1.ImageList = Me.ImageList1
    For i = 1 To 5
    
    TreeView1.Nodes.Add , , "ROOT" & i, "Root Item " & i, 1
    
    Next
    '
    ' Now add some children
    '
    For i = 1 To 5
    With TreeView1.Nodes
    .Add "ROOT1", tvwChild, "ROOT1CHILD" & i, "Child Item " & i, 2
    .Add "ROOT2", tvwChild, "ROOT2CHILD" & i, "Child Item " & i, 2
    .Add "ROOT3", tvwChild, "ROOT3CHILD" & i, "Child Item " & i, 2
    .Add "ROOT4", tvwChild, "ROOT4CHILD" & i, "Child Item " & i, 2
    .Add "ROOT5", tvwChild, "ROOT5CHILD" & i, "Child Item " & i, 2
    End With
    Next
    End Sub
    Last edited by doberman2002; Oct 14th, 2019 at 05:34 PM.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: how to populate listview with this file

    Your question is regarding a listview, yet your sample code is for a treeveiw.

    If you spend some time learning how to use DOM to parse XML data, I think you could dramatically improve your ability to extract the data easier
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: how to populate listview with this file

    I can't tell how many of these questions are headed down the rabbit hole of trying to use controls in place of data structures. There doesn't seem to be any reason to display the information and there isn't any user interaction with it.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2019
    Posts
    194

    Re: how to populate listview with this file

    Quote Originally Posted by LaVolpe View Post
    Your question is regarding a listview, yet your sample code is for a treeveiw.

    If you spend some time learning how to use DOM to parse XML data, I think you could dramatically improve your ability to extract the data easier
    Code:
    Private Sub Command2_Click()
    Dim myXMLfile As DOMDocument60
        Dim xmlElement As IXMLDOMElement
        Dim xmlNodes As IXMLDOMNodeList
        Dim x As Long
    
        Set myXMLfile = New DOMDocument60
        myXMLfile.setProperty "ProhibitDTD", False
        myXMLfile.validateOnParse = False
     myXMLfile.Load "C:\Users\parry\Desktop\listview rom\MAME 0.37b5.dat"
    
    
        Set xmlNodes = myXMLfile.documentElement.selectNodes("game[rom[@name='" & "rom name" & "']]")
        For x = 0 To xmlNodes.length - 1
      
            Set xmlElement = xmlNodes(x)
           ' Debug.Print xmlElement.getAttribute("name")
            
            List1.AddItem xmlElement.getAttribute("name") 
            Next
    
    End Sub

    Code:
    <datafile>
    	<header>
    		<name>MAME</name>
    		<description>MAME 0.37b5</description>
    		<category>EMULATION</category>
    		<version>0.37b5</version>
    		<date>-not specified-</date>
    		<author>AntoPISA</author>
    		<email>progettosnaps@gmail.com</email>
    		<homepage>http://www.progettosnaps.net/</homepage>
    		<url>-not specified-</url>
    		<comment>-not specified-</comment>
    		<clrmamepro/>
    	</header>
    	<game name="005">
    		<description>005</description>
    		<year>1981</year>
    		<manufacturer>Sega</</game>manufacturer>
    		<rom name="1346b.u25" size="2048" crc="8e68533e"/>
    		<rom name="5092.u1" size="2048" crc="29e10a81"/>
    		<rom name="5093.u2" size="2048" crc="e1edc3df"/>
    		<rom name="5094.u3" size="2048" crc="995773bb"/>
    		<rom name="5095.u4" size="2048" crc="f887f575"/>
    		<rom name="5096.u5" size="2048" crc="5545241e"/>
    		<rom name="5097.u6" size="2048" crc="428edb54"/>
    		<rom name="5098.u7" size="2048" crc="5bcb9d63"/>
    		<rom name="5099.u8" size="2048" crc="0ea24ba3"/>
    		<rom name="5100.u9" size="2048" crc="a79af131"/>
    		<rom name="5101.u10" size="2048" crc="8a1cdae0"/>
    		<rom name="5102.u11" size="2048" crc="70826a15"/>
    		<rom name="5103.u12" size="2048" crc="7f80c5b0"/>
    		<rom name="5104.u13" size="2048" crc="0140930e"/>
    		<rom name="5105.u14" size="2048" crc="17807a05"/>
    		<rom name="5106.u15" size="2048" crc="c7cdfa9d"/>
    		<rom name="5107.u16" size="2048" crc="95f8a2e6"/>
    		<rom name="5108.u17" size="2048" crc="d371cacd"/>
    		<rom name="5109.u18" size="2048" crc="48a20617"/>
    		<rom name="5110.u19" size="2048" crc="7d26111a"/>
    		<rom name="5111.u20" size="2048" crc="a888e175"/>
    		<rom name="epr-1286.16" size="2048" crc="fbe0d501"/>
    	</game>
    not working which part did i do wrong
    Last edited by doberman2002; Oct 15th, 2019 at 01:31 PM.

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: how to populate listview with this file

    Your XPath query is incorrect: "rom name"?
    Look at your previous thread where I helped you parse XML
    http://www.vbforums.com/showthread.p...etbetween-help
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Aug 2019
    Posts
    194

    Re: how to populate listview with this file

    Quote Originally Posted by LaVolpe View Post
    Your XPath query is incorrect: "rom name"?
    Look at your previous thread where I helped you parse XML
    http://www.vbforums.com/showthread.p...etbetween-help
    am trying here is the part
    Code:
    Dim myXMLfile As DOMDocument60
        Dim xmlElement As IXMLDOMElement
        Dim xmlNodes As IXMLDOMNodeList
        Dim x As Long
    
        Set myXMLfile = New DOMDocument60
        myXMLfile.setProperty "ProhibitDTD", False
        myXMLfile.validateOnParse = False
        myXMLfile.Load "C:\Users\parry\Desktop\listview rom\MAME 0.37b5.dat"
     
        Set xmlNodes = myXMLfile.documentElement.selectNodes("game[rom[@name='03k_sb-8.bin']]")
        For x = 0 To xmlNodes.length - 1
      
            Set xmlElement = xmlNodes(x)
           ' Debug.Print xmlElement.getAttribute("name")
            
            List1.AddItem xmlElement.getAttribute("name")
            Next
    Code:
    ("game[rom[@name='03k_sb-8.bin']]")
    List1.AddItem xmlElement.getAttribute("name")
    am trying to learn how this works kind of stuck, can you give me a little instruction how to extract them string this seems interesting been doing it for one hour still no go.


    Code:
    <game name="1941">
    		<description>1941 - Counter Attack (World)</description>
    		<year>1990</year>
    		<manufacturer>Capcom</manufacturer>
    		<rom name="41_09.rom" size="65536" crc="0f9d8527"/>
    		<rom name="41_18.rom" size="131072" crc="d1f15aeb"/>
    		<rom name="41_19.rom" size="131072" crc="15aec3a6"/>
    		<rom name="41_32.rom" size="524288" crc="4e9648ca"/>
    		<rom name="41_gfx1.rom" size="524288" crc="ff77985a"/>
    		<rom name="41_gfx3.rom" size="524288" crc="983be58f"/>
    		<rom name="41_gfx5.rom" size="524288" crc="01d1cb11"/>
    		<rom name="41_gfx7.rom" size="524288" crc="aeaa3509"/>
    		<rom name="41e_30.rom" size="131072" crc="9deb1e75"/>
    		<rom name="41e_31.rom" size="131072" crc="df201112"/>
    		<rom name="41e_35.rom" size="131072" crc="d63942b3"/>
    		<rom name="41e_36.rom" size="131072" crc="816a818f"/>
    	</game>

  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: how to populate listview with this file

    Using your exact code and the file you posted in #1 above, I get 3 games: 1942, 1942a, 1942b

    Whenever something is not working, you should explain in detail what you are expecting and any errors you are getting. If you are using On Error Resume Next, then don't do that -- you'll hide errors that could be telling you what is wrong.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Aug 2019
    Posts
    194

    Re: how to populate listview with this file

    Quote Originally Posted by LaVolpe View Post
    Using your exact code and the file you posted in #1 above, I get 3 games: 1942, 1942a, 1942b

    Whenever something is not working, you should explain in detail what you are expecting and any errors you are getting. If you are using On Error Resume Next, then don't do that -- you'll hide errors that could be telling you what is wrong.
    am trying to learn more about how to use this in depth.
    Code:
    ("game[rom[@name='03k_sb-8.bin']]")
    List1.AddItem xmlElement.getAttribute("name")
    for the sake of learning i want to extract all
    <rom name="41_09.rom" 41_09.rom strings in red area and load it up in treeview with parant rom title?.
    once i get the hang of it i can step forward test more my self am just stuck at this
    Code:
    ("game[rom[@rom name=]]")
    List1.AddItem xmlElement.getAttribute("name")
    i just want to learn how to pull them data out using xml method,xml seems very fast and i like it am just learning still.


    ok update i finally messed about did this and extracted all titles

    Code:
    Private Sub Command4_Click()
    List1.Clear
    Dim myXMLfile As DOMDocument60
        Dim xmlElement As IXMLDOMElement
        Dim xmlNodes As IXMLDOMNodeList
        Dim x As Long
    
        Set myXMLfile = New DOMDocument60
        myXMLfile.setProperty "ProhibitDTD", False
        myXMLfile.validateOnParse = False
     myXMLfile.Load "C:\Users\parry\Desktop\listview rom\MAME 0.37b5.dat"
    
    
        Set xmlNodes = myXMLfile.documentElement.selectNodes("game")
        For x = 0 To xmlNodes.length - 1
      
            Set xmlElement = xmlNodes(x)
           ' Debug.Print xmlElement.getAttribute("name")
            
            List1.AddItem xmlElement.getAttribute("name") '& ".zip"
            Next
    
    End Sub
    Last edited by doberman2002; Oct 15th, 2019 at 03:24 PM.

  9. #9
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: how to populate listview with this file

    Open that dat file...

    game[rom[@name='03k_sb-8.bin']]

    the [ ] above are like parentheses
    game :: only look at 1st child elements where its element is <game [optional attributes]>
    rom :: only look at child elements of <game> where child name is <rom [optional attributes]>
    @name :: only look for attributes of <game><rom> where attribute name is "name" and value is: 03k_sb-8.bin
    the @ symbol means: attribute

    so, only these elements will be returned, if any
    <game [optional attributes]> having child elements like: <rom name="03k_sb-8.bin" [other optional attributes]>

    Look at sites that have tutorials for: XPath queries
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Aug 2019
    Posts
    194

    Re: how to populate listview with this file

    Quote Originally Posted by LaVolpe View Post
    Open that dat file...

    game[rom[@name='03k_sb-8.bin']]

    the [ ] above are like parentheses
    game :: only look at 1st child elements where its element is <game [optional attributes]>
    rom :: only look at child elements of <game> where child name is <rom [optional attributes]>
    @name :: only look for attributes of <game><rom> where attribute name is "name" and value is: 03k_sb-8.bin
    the @ symbol means: attribute

    so, only these elements will be returned, if any
    <game [optional attributes]> having child elements like: <rom name="03k_sb-8.bin" [other optional attributes]>

    Look at sites that have tutorials for: XPath queries
    ok update i finally messed about did this and extracted all titles

    Code:
    Private Sub Command4_Click()
    List1.Clear
    Dim myXMLfile As DOMDocument60
        Dim xmlElement As IXMLDOMElement
        Dim xmlNodes As IXMLDOMNodeList
        Dim x As Long
    
        Set myXMLfile = New DOMDocument60
        myXMLfile.setProperty "ProhibitDTD", False
        myXMLfile.validateOnParse = False
     myXMLfile.Load "C:\Users\parry\Desktop\listview rom\MAME 0.37b5.dat"
    
    
        Set xmlNodes = myXMLfile.documentElement.selectNodes("game")
        For x = 0 To xmlNodes.length - 1
      
            Set xmlElement = xmlNodes(x)
           ' Debug.Print xmlElement.getAttribute("name")
            
            List1.AddItem xmlElement.getAttribute("name") '& ".zip"
            Next
    
    End Sub
    can you post just example code of this line.
    Code:
    ("game[rom[@name='03k_sb-8.bin']]")
    List1.AddItem xmlElement.getAttribute("name")
    how you will tell the code to extract that rom name= only

    ok this also pulls names again

    Code:
    Private Sub Command5_Click()
    List1.Clear
    Dim myXMLfile As DOMDocument60
        Dim xmlElement As IXMLDOMElement
        Dim xmlNodes As IXMLDOMNodeList
        Dim x As Long
    
        Set myXMLfile = New DOMDocument60
        myXMLfile.setProperty "ProhibitDTD", False
        myXMLfile.validateOnParse = False
     myXMLfile.Load "C:\Users\parry\Desktop\listview rom\MAME 0.37b5.dat"
    
        Set xmlNodes = myXMLfile.documentElement.selectNodes("game[rom[@rom]]")
        For x = 0 To xmlNodes.length - 1
            Set xmlElement = xmlNodes(x)
            List1.AddItem xmlElement.getAttribute("name")
            Next
    End Sub
    am trying to get to extract the rom name secion trying.
    Code:
    Set xmlNodes = myXMLfile.documentElement.selectNodes("rom[@name]")
    nothing?
    Last edited by doberman2002; Oct 15th, 2019 at 03:42 PM.

  11. #11
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: how to populate listview with this file

    The rom name attribute value of each game element would be:

    ("game/rom")
    List1.AddItem xmlElement.getAttribute("name")

    Look at this example:
    Code:
    Private Sub Command4_Click()
    List1.Clear
    Dim myXMLfile As DOMDocument60
        Dim xmlElement As IXMLDOMElement
        Dim xmlNodes As IXMLDOMNodeList
        Dim xmlROMs As IXMLDOMNodeList
        Dim x As Long, r As Long
    
        Set myXMLfile = New DOMDocument60
        myXMLfile.setProperty "ProhibitDTD", False
        myXMLfile.validateOnParse = False
     myXMLfile.Load "C:\Users\parry\Desktop\listview rom\MAME 0.37b5.dat"
    
        Set xmlNodes = myXMLfile.documentElement.selectNodes("game")
        For x = 0 To xmlNodes.length - 1
            Set xmlElement = xmlNodes(x)
            Debug.Print xmlElement.getAttribute("name")
            
            Set xmlROMs = xmlNodes(x).selectNodes("rom")
            For r = 0 To xmlROMs.length - 1
                Set xmlElement = xmlROMs(r)
                Debug.Print vbTab; xmlElement.getAttribute("name")
            Next
        Next
    
    End Sub
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Aug 2019
    Posts
    194

    Re: how to populate listview with this file

    Quote Originally Posted by LaVolpe View Post
    The rom name attribute value of each game element would be:

    ("game/rom")
    List1.AddItem xmlElement.getAttribute("name")

    Look at this example:
    Code:
    Private Sub Command4_Click()
    List1.Clear
    Dim myXMLfile As DOMDocument60
        Dim xmlElement As IXMLDOMElement
        Dim xmlNodes As IXMLDOMNodeList
        Dim xmlROMs As IXMLDOMNodeList
        Dim x As Long, r As Long
    
        Set myXMLfile = New DOMDocument60
        myXMLfile.setProperty "ProhibitDTD", False
        myXMLfile.validateOnParse = False
     myXMLfile.Load "C:\Users\parry\Desktop\listview rom\MAME 0.37b5.dat"
    
        Set xmlNodes = myXMLfile.documentElement.selectNodes("game")
        For x = 0 To xmlNodes.length - 1
            Set xmlElement = xmlNodes(x)
            Debug.Print xmlElement.getAttribute("name")
            
            Set xmlROMs = xmlNodes(x).selectNodes("rom")
            For r = 0 To xmlROMs.length - 1
                Set xmlElement = xmlROMs(r)
                Debug.Print vbTab; xmlElement.getAttribute("name")
            Next
        Next
    
    End Sub
    thanks lavlope am not going to close this thread as i will be doing more test to learn from your code this is incredible.
    the way you done it is way different to code i posted.
    let me copy and paste binary code from your brain to mine?
    Last edited by doberman2002; Oct 15th, 2019 at 03:48 PM.

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Aug 2019
    Posts
    194

    Re: how to populate listview with this file

    How do i add all the child items
    Code:
    Private Sub Command8_Click()
     Dim i As Integer
    Set Me.TreeView1.ImageList = Me.ImageList1
    Dim myXMLfile As DOMDocument60
        Dim xmlElement As IXMLDOMElement
        Dim xmlNodes As IXMLDOMNodeList
        Dim x As Long
    
        Set myXMLfile = New DOMDocument60
        myXMLfile.setProperty "ProhibitDTD", False
        myXMLfile.validateOnParse = False
     myXMLfile.Load "C:\Users\parry\Desktop\listview rom\MAME 0.37b5.dat"
    
        Set xmlNodes = myXMLfile.documentElement.selectNodes("game")
        For x = 0 To xmlNodes.length - 1
      
            Set xmlElement = xmlNodes(x)
            TreeView1.Nodes.Add , , "ROOT" & x, xmlElement.getAttribute("name"), 1
            Next
            
    
    End Sub
    child code
    Code:
    Private Sub Command14_Click()
    Set Me.TreeView1.ImageList = Me.ImageList1
    Dim myXMLfile As DOMDocument60
        Dim xmlElement As IXMLDOMElement
        Dim xmlNodes As IXMLDOMNodeList
        Dim xmlROMs As IXMLDOMNodeList
        Dim x As Long, r As Long
    
        Set myXMLfile = New DOMDocument60
        myXMLfile.setProperty "ProhibitDTD", False
        myXMLfile.validateOnParse = False
     myXMLfile.Load "C:\Users\parry\Desktop\listview rom\MAME 0.37b5.dat"
    
        Set xmlNodes = myXMLfile.documentElement.selectNodes("game")
        For x = 0 To xmlNodes.length - 1
            Set xmlElement = xmlNodes(x)
            Debug.Print xmlElement.getAttribute("name")
            
            Set xmlROMs = xmlNodes(x).selectNodes("rom")
            For r = 0 To xmlROMs.length - 1
                Set xmlElement = xmlROMs(r)
               ' List1.AddItem xmlElement.getAttribute("name")
                TreeView1.Nodes.Add "ROOT" & r, tvwChild, "ROOT1CHILD" & r, xmlElement.getAttribute("name"), 2
            Next
        Next
    End Sub
    key is not unique in collection,how do i add each rom name as child belonging to its parent title in treeview
    Last edited by doberman2002; Oct 15th, 2019 at 06:26 PM.

  14. #14
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: how to populate listview with this file

    Don't both ListView and TreeView have a 32767 node limit anyway?

    I'd use SAX2 and the MSHFlexGrid for this sort of thing. Assuming of course that it makes sense to list everything, which I doubt.

    Name:  sshot.png
Views: 324
Size:  5.5 KB

    XML DOMs are pretty bloated to begin with and don't do that well for large documents. Then when you add the scripter's tool XPath to the mix... things gear down pretty quickly to a crawl.

    There's a good reason we have SAX2, and even the DOM uses it internally to do its parsing.
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width