Official Content

The Name property returns the tag name of the selected element.

Syntax

&DataType.Name

Type Returned

Character

Example

XML file

<?xml version="1.0" encoding="ISO-8859-1" ?>
<MEETING Date="08/28/12">
     <DATE>08/28/12</DATE>
     <!—Meeting description-->
     <MEMBERS>
          <MEMBER>Peter</MEMBER>
          <MEMBER>Laura</MEMBER>
          <MEMBER>John</MEMBER>
          <MEMBER>Diana</MEMBER>
     </MEMBERS>
</MEETING>

A possible process could be:

Event 'ReadXML'
    &xmlreader.Open('file.xml')
    &xmlreader.ReadType(1, 'MEMBERS')
    &xmlreader.read()
    do while &xmlreader.name <> 'MEMBERS'
       &character = &xmlreader.value + " - " + &character
       &xmlreader.read()
    enddo
    &xmlreader.close()
    msg(&xmlreader.ErrDescription)
EndEvent

Scope

Extended Data Types:   XMLReader
Languages: .NET, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)


See Also

XmlReader Data Type






Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant