XML Load with Validation

XML Load with Validation

  
When i call

XMLDocument_Load("debtors3.xml" ,"debtors.xsd" )

To load a XML Document with XSD validation, the action ends with the message below, i already validated the XML with the same XSD in a xml editor and the xml is valid.

[1] Data at the root level is invalid. Line 1, position 1.
Stack:

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.Schema.Parser.StartParsing(XmlReader reader, String targetNamespace)
at System.Xml.Schema.Parser.Parse(XmlReader reader, String targetNamespace)
at System.Xml.Schema.XmlSchema.Read(XmlReader reader, ValidationEventHandler validationEventHandler)
at OutSystems.NssXml.CssXml.LoadXml_Validate(String ssXml, String ssXsd, Object& ssXmlDocument, Boolean& valid, RLXmlErrorRecordList& errors)
at OutSystems.NssXml.CssXml.MssXmlDocument_Load(String ssXml, String ssXsd, Object& ssXmlDocument, Boolean& ssIsValid, RLXmlErrorRecordList& ssErrors)
at ssDocumentStore.RssExtensionXml.MssXmlDocument_Load(HeContext heContext, String inParamXml, St...aramXmlDocument, Boolean& outParamIsValid, RLXmlErrorRecordList& outParamErrors)
at ssDocumentStore.Actions.UserActionValidateXML(HeContext heContext, RCXmlErrorRecord& outParamXmlErrors, String& outParamIsValid)
at ssDocumentStore.Flows.FlowSampleFlow.ScrnBackOfficeScreen.CommandTest_XML(HeContext heContext)
at ssDocumentStore.Flows.FlowSampleFlow.ScrnBackOfficeScreen.wt_Submitwidget421944_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)




Hi Matthias,

The XMLDocument_Load should receive the XML content and not the XML file path. You can check this if you open the XML extension in OutSystems Integration Studio. The XSD is optional.
If you have the file in the server you can use RichMail.HttpGet or FileSystem.File_ReadText to read the file's contents to use afterward in XMLDocument_Load.

Cheers,
Tiago Simões
Thanks! that did work, another question is their a maximum for the XML file size?