Retrieving elements from xml documents 
Author Message
 Retrieving elements from xml documents

I am having a problem getting the value of an element into a string variable in
my program. For example with a xml document like :

<?xml version="1.0" encoding="UTF-8"?>
<Form>
        <FormType>receipt</FormType>
        <FormName>654321</FormName>
</Form>

I want to return "receipt" and "654321" into two local string variables. My
problem is the document will have more content and could change over
time ,although the tags "FormType" and "FormName" won't change, and I don't want
to have to re-code just for that. Is it possible to write code to extract those
values out no matter where they are in the xml document? If so how?
Thanks.



Wed, 06 Aug 2003 01:42:56 GMT  
 Retrieving elements from xml documents
like

XmlDocument.GetElementsByTagName  ?

---jeff


I am having a problem getting the value of an element into a string variable
in
my program. For example with a xml document like :

<?xml version="1.0" encoding="UTF-8"?>
<Form>
<FormType>receipt</FormType>
<FormName>654321</FormName>
</Form>

I want to return "receipt" and "654321" into two local string variables. My
problem is the document will have more content and could change over
time ,although the tags "FormType" and "FormName" won't change, and I don't
want
to have to re-code just for that. Is it possible to write code to extract
those
values out no matter where they are in the xml document? If so how?
Thanks.



Wed, 06 Aug 2003 13:26:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VC++ and XML, I want to retrieve an XML file from URL

2. VC++ and XML, I want to retrieve an XML file from a URL

3. ATL: set and retrieve variant data elements

4. Retrieving Safearray elements

5. Xml element

6. XML ELEMENT tag names in tree

7. How can i get the values of all elements under certain level in XML tree

8. want to get value of XML element at certain level

9. XML Element Matching

10. XML ELEMENT REMOVING

11. How can get the element value out the XML when it has variable tag name

12. XML elements

 

 
Powered by phpBB® Forum Software