|
-
Aug 18th, 2012, 07:41 AM
#1
Thread Starter
Addicted Member
How to get the Namespace string i.e. first element attribute value
I have a namespace declaration/FirstElement like:
<Code>.<FirstElementName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xmlns=urn:filename-schema" </Code>
Which namespace is the attribute for this element? If I wanted to pick up only the last namespace I.e. (xmlns=urn:filename-schema"), how do I do that? I have tried:
<Code>.
Dim root As XmlNode = myDoc.FirstChild. 'First node
Dim firstElement As XmlNode = root.FirstChild. 'First element
Dim firstElementValue As string = firstElement.Value
</Code>
I get the exception: Object reference not set to an instance of an object. I have tried the: XmlAttribute and XmlNode, instances in place of 'String' with no success. Confused now. Please help. Thanks
-
Aug 18th, 2012, 10:04 AM
#2
Re: How to get the Namespace string i.e. first element attribute value
Not the only one, I'm afraid! What are you actually trying to do?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|