M
Mike [MCP VB]
Hi, I hope this is the right place to ask.
I have an xml file thus:
<?xml version="1.0" encoding="UTF-8"?>
<Message xmlns="urn:myurl-org:ns2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:myurl-org:ns2
...\Schemas\schema.xsd" type="Message">
<id root="7DC0FFE7-1224-4598-8F20-3B7662D416A1"/>
<creationTime value="2004"/>
<acknowledgement typeCode="AE">
<messageRef>
<id root="04074443-DE90-4FE8-9D4A-DBF9A7E81FFA"/>
</messageRef>
</acknowledgement>
</Message>
I wish to be able to parse the file such that I can return the root
attribute of the id node within messageRef.
Unfortunately, I cannot do this using msxml. getElementByTagName doesn't
work because a default namespace is provided. In fact, I cannot loop through
the nodes either, as msxml only suggests the document has one node <Message
/>, but no children.
I am considering swapping over from VB6 to VB.NET to accomplish this task,
as I've heard the system.xml namespace contains a revised implementation of
the DOM object that will allow use of getElementByTagName with default
namespaces.
Could anyone proffer the code to return the above attribute (as string, or
ixmlattributenode)?
Many thanks in advance.
Mike
I have an xml file thus:
<?xml version="1.0" encoding="UTF-8"?>
<Message xmlns="urn:myurl-org:ns2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:myurl-org:ns2
...\Schemas\schema.xsd" type="Message">
<id root="7DC0FFE7-1224-4598-8F20-3B7662D416A1"/>
<creationTime value="2004"/>
<acknowledgement typeCode="AE">
<messageRef>
<id root="04074443-DE90-4FE8-9D4A-DBF9A7E81FFA"/>
</messageRef>
</acknowledgement>
</Message>
I wish to be able to parse the file such that I can return the root
attribute of the id node within messageRef.
Unfortunately, I cannot do this using msxml. getElementByTagName doesn't
work because a default namespace is provided. In fact, I cannot loop through
the nodes either, as msxml only suggests the document has one node <Message
/>, but no children.
I am considering swapping over from VB6 to VB.NET to accomplish this task,
as I've heard the system.xml namespace contains a revised implementation of
the DOM object that will allow use of getElementByTagName with default
namespaces.
Could anyone proffer the code to return the above attribute (as string, or
ixmlattributenode)?
Many thanks in advance.
Mike