473,320 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Read Node values from xml inVB

hi,
i wanna read the node values from xml. As per my code i can read the node values in first child node and for the next node am not able to read the node values. pls help me.
i'll paste the code below:

Sub readfile()

objxmldom.async = False
objxmldom.Load ("D:\CRT\rules\AQUA.xml")


On Error GoTo ErrorHandler:

Dim nodevalue, node1, nodevalue2, nodevalue3
Set objnodes = objxmldom.selectNodes("/Coors_Rules")
For Each OBJBOOKNODE In objnodes

If OBJBOOKNODE.selectNodes("CATEGORY").length <> 0 Then
MsgBox OBJBOOKNODE.selectNodes("CATEGORY").length
For j = 0 To OBJBOOKNODE.selectNodes("CATEGORY").length

node1 = OBJBOOKNODE.selectNodes("CATEGORY").Item(J).Attrib utes.getNamedItem("TYPE").nodeTypedValue
MsgBox node1

If node1 = "NAMING" Then
MsgBox OBJBOOKNODE.selectSingleNode("CATEGORY").selectNod es("OBJRULE").length
For i = 0 To OBJBOOKNODE.selectSingleNode("CATEGORY").selectNod es("OBJRULE").length

node2 = OBJBOOKNODE.selectSingleNode("CATEGORY").selectNod es("OBJRULE").Item(i).Attributes.getNamedItem("OBJ NAME").nodeTypedValue

MsgBox node2
NODES(1) = OBJBOOKNODE.selectSingleNode("CATEGORY").selectNod es("OBJRULE").Item(i).Attributes.getNamedItem("PRO PERTY").nodeTypedValue
MsgBox NODES(1)
NODES(2) = OBJBOOKNODE.selectSingleNode("CATEGORY").selectNod es("OBJRULE").Item(i).Attributes.getNamedItem("VAL UE").nodeTypedValue
MsgBox NODES(2)
NODES(3) = OBJBOOKNODE.selectSingleNode("CATEGORY").selectNod es("OBJRULE").Item(i).Attributes.getNamedItem("SEV ERITY").nodeTypedValue
MsgBox NODES(3)
Next
End If

End If

Next OBJBOOKNODE



Exit Sub ' Exit to avoid handler.

ErrorHandler: ' Error-handling routine.
End
End Sub


my xml file is like tis:

- <Coors_Rules CREATION_DATE="18.12.2007" VERSION="1.0">
- <CATEGORY TYPE="NAMING" DESCRIPTION="NAMING STANDARDS">
<OBJRULE OBJNAME="RDB_SOURCE_SEQUENCES" PROPERTY="START_VALUE" VALUE="7" SEVERITY="ERROR" />
<OBJRULE OBJNAME="VIEW_INGRP" PROPERTY="END_VALUE" VALUE="6" SEVERITY="WARNING" />
</CATEGORY>
- <CATEGORY TYPE="DOCUMENTATION" DESCRIPTION="DOCUMENTATION STANDARDS">
<OBJRULE OBJNAME="MAPPING" PROPERTY="MIN_CHARS" VALUE="1" SEVERITY="ERROR" />
<OBJRULE OBJNAME="OPERATORS" PROPERTY="MIN_CHARS" VALUE="2" SEVERITY="ERROR" />
</CATEGORY>
</Coors_Rules>

The actual issue is am able to read the first child type="naming" and not the second chile type="Documentation"
PLS REPLY AS SOON AS POSSIBLE. AND TOO URGENT!!
THANKS
Dec 28 '07 #1
0 1704

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
1
by: Chua Wen Ching | last post by:
Hi there, I have some problems when reading XML file. 1. First this, is what i did, cause i can't seem to read "sub elements or tags" values, so i place those values into attributes like this....
9
by: B-Dog | last post by:
I'm trying to read two nodes in an xml file that I'm using to store setting but I'm having a hard time trying to read the values of two nodes. Below I can read one node but I need to be able to...
3
by: Dan Aldean | last post by:
Hi, I create this XML document: <?xml version="1.0"?> <Bookstore> <Book Genre="Novel" Style="hardcover"> <author> <first-name>Margaret</first-name> <last-name>Atwood</last-name> </author>
9
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still...
4
by: Pim75 | last post by:
Hello, I have to read a XML file in ASP and save the values in a database. I can get this work, but I cannot read some nested nodes of the xml file. This is a part of the XML file: ...
6
by: | last post by:
Hi, I'm steel trying to read and update my XML file with Visual Basic Express but i am unable to find the right way to read my xml file and update it if neccessary... Here is my problem :...
13
by: rohit | last post by:
Hi All, I am new to C language.I want to read integers from a text file and want to do some operation in the main program.To be more specific I need to multiply each of these integers with another...
8
by: =?Utf-8?B?WVhR?= | last post by:
I want to do the multi-language program, save the language text in XML file, but how to read the specified node value? the xml is below, for example, i want to get the value(AAA content) that named...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.