I try to read information from the XML file, I created a simple XML file
<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlnsd="urn:schemas-upnp-org:device-1-0" generated="2015-12-11T15:07:54">
<S>
<in>A1</in>
</S>
<S>
<in>A2</in>
</S>
<S>
<in>A3</in>
</S>
<S>
<in>A4</in>
</S>
<S>
<in>D1</in>
</S>
</dataroot>
and activated it in the right pane file manager
but in the emulator CML file is not initialized. I think the problem with the file location?
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("StartScreen")
' 'the BuildFromString method is used here as the BuildFromFile method cannot access files in assets
Dim XmlString As String
XmlString=File.GetText(File.DirAssets, "spravin.xml")
Dim XOMBuilder1 As XOMBuilder
XOMBuilder1.Initialize("XOMBuilder1")
XOMBuilder1.BuildFromString(XmlString, "", Null)
Msgbox(XOMBuilder1.IsInitialized,"")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub XOMBuilder1_BuildDone(XOMDoc As XOMDocument, Tag As Object)
If XOMDoc.IsInitialized Then
Dim RootElement As XOMElement=XOMDoc.RootElement
Dim ItemsElements As XOMElements
ItemsElements= RootElement.GetChildElementsByName("S")
N_Item = ItemsElements.Size
Else
Msgbox("File problem","")
End If
End Sub
<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlnsd="urn:schemas-upnp-org:device-1-0" generated="2015-12-11T15:07:54">
<S>
<in>A1</in>
</S>
<S>
<in>A2</in>
</S>
<S>
<in>A3</in>
</S>
<S>
<in>A4</in>
</S>
<S>
<in>D1</in>
</S>
</dataroot>
and activated it in the right pane file manager
but in the emulator CML file is not initialized. I think the problem with the file location?
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("StartScreen")
' 'the BuildFromString method is used here as the BuildFromFile method cannot access files in assets
Dim XmlString As String
XmlString=File.GetText(File.DirAssets, "spravin.xml")
Dim XOMBuilder1 As XOMBuilder
XOMBuilder1.Initialize("XOMBuilder1")
XOMBuilder1.BuildFromString(XmlString, "", Null)
Msgbox(XOMBuilder1.IsInitialized,"")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub XOMBuilder1_BuildDone(XOMDoc As XOMDocument, Tag As Object)
If XOMDoc.IsInitialized Then
Dim RootElement As XOMElement=XOMDoc.RootElement
Dim ItemsElements As XOMElements
ItemsElements= RootElement.GetChildElementsByName("S")
N_Item = ItemsElements.Size
Else
Msgbox("File problem","")
End If
End Sub