Someone know how to use a xml file from data section?
Thanks in advance!
With this code I get: ""XML error on line 1: encoding specified in XML declaration is incorrect.""
The line 1 is: <?xml version="1.0" encoding="UTF-8"?>
Code: Select all
#Dialog = 0
#Xml = 0
XML$ = PeekS(?XmlInterface,-1,#PB_UTF8)
If CatchXML(#Xml, @XML$, StringByteLength(XML$)) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "window_1")
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Else
MessageRequester("ERROR","Dialog creation error: " + DialogError(#Dialog))
Debug "Dialog creation error: " + DialogError(#Dialog)
EndIf
Else
MessageRequester("ERROR","XML error on line " + XMLErrorLine(#Xml) + ": " + XMLError(#Xml))
Debug "XML error on line " + XMLErrorLine(#Xml) + ": " + XMLError(#Xml)
EndIf
CloseWindow(window_1)
EndProcedure
;--------------------------------------------- Data -------------------------------------------------
DataSection
XmlInterface:
IncludeBinary "C:\Users\Usuario\Documents\PureBasic\file.xml"
Data.u #Null
EndDataSection