XMLReader

Aspire89

Member
Licensed User
there is a xml file:

B4X:
<Book Xmln="bk" genre="novel">
   <title> my book </ title>
   <price> 19.95 </ price>
   <ISBN> 1-861003-781-861003-78 </ ISBN>
   <style> hardcover </ style>
</ Book>

how to make in XmlnTextBox paste "bk", in GenreTextBox paste "novel", in TitleTextBox paste "my book", etc, thanks.
 

Aspire89

Member
Licensed User
I watched XMLdemo.sbp, but did not understand :sign0104:, I need to make a specific value is loaded into a TextBox, in the example, all come together and displayed in the msgbox.
 

agraham

Expert
Licensed User
Longtime User
Play with this simple version of XMLread. Test the element and attribute names for what you want and write the values to your textboxes.
B4X:
Sub SimpleReadXML
  rdr.Open(AppPath & "\test.xml")   
  rdr.Read
  Do
    msg = msg & rdr.NodeType  & ": " rdr.Name & " " & rdr.Value & CRLF
    If rdr.AttributeCount > 0 Then
      Do While rdr.MoveToNextAttribute
        msg = msg & "AttribName: " & rdr.Name & " AttribValue: " & rdr.Value & CRLF
      Loop            
    End If
  Loop Until rdr.Read = False
 Msgbox(msg)
End Sub
 

Aspire89

Member
Licensed User
agraham, thanks, simple example of help, I do not think that would be so difficult.
 
Top