Process XML document
Hi all,
I am looking at a task which involves processing an XML file. Picking the file up from a folder (c:\test.xml) reading the data out of the XML and archiving the xml after it has been processed.
I was wondering what the best way of doing this would be?
I have got as far as creating a service in Ensemble. The Service I have created uses the class name EnsLib.XML.Object.Service.FileService.
Any advice or tutorials/guides would be much appreciated.
Many Thanks
Comments
A little more information.
This is the XML I have:
<?xml version="1.0" encoding="UTF-8"?><ICNARCxmlns="http://tempuri.org/ICMPDSv3_1.xsd"><ADMISSION><InpatientSpellidentifier>53352</InpatientSpellidentifier><ACON>U</ACON><ACSD>0</ACSD></ADMISSION></ICNARC>This is the class
Class pacIPM.reqICNARC Extends (%Persistent, %Populate, %XML.Adaptor)
{
Property InpatientSpellidentifier As%String;Property ACON As%String;Property ACSD As%String;
}However, I am getting the following error when I enable the service.
ERROR #6232: Datatype validation failed for tag, ADMISSION (ending at line 3 character 13), with value:
In your Business Service settings set ClassName to pacIPM.reqICNARC and ElementName to ADMISSION.
I think you set only ClassName and did not set ElementName. In that case interoperability tries to match root object - ICNARC in your case to pacIPM.reqICNARC, and it fails because pacIPM.reqICNARC class does not have ADMISSION property.
Thank you, that resolved the issue!