A Aspire89 Member Licensed User Mar 19, 2009 #1 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.
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.
agraham Expert Licensed User Longtime User Mar 19, 2009 #2 You need to look at the ReadXML Sub in XMLdemo.sbp and understand what it is doing. It is reading and displaying the information that you want.
You need to look at the ReadXML Sub in XMLdemo.sbp and understand what it is doing. It is reading and displaying the information that you want.
A Aspire89 Member Licensed User Mar 19, 2009 #3 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.
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 Mar 19, 2009 #4 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
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
A Aspire89 Member Licensed User Mar 20, 2009 #5 agraham, thanks, simple example of help, I do not think that would be so difficult.