Question
· Jan 15

parse XML to object

hi there,when i use %XML.Reader parse XML to object,if the element value is null,the data in the table is $c(0),how avoid this?

my class file like this:

Class M.PATLIST Extends (%RegisteredObject, %XML.Adaptor) [ Inheritance = right, Not ProcedureBlock ]
{ Property Data As list Of PAT(XMLPROJECTION = "ELEMENT"); Parameter XMLIGNOREINVALIDTAG = 1; Parameter XMLIGNORENULL = 1; Parameter XMLNAME = "DATALIST"; }

Class M.PAT Extends (%Persistent, %XML.Adaptor) [ Inheritance = right, Not ProcedureBlock ]
{ Property CSRQ As %Date; Property CYZZDBM As %String(MAXLEN = "", TRUNCATE = 1); Property CYZZDMC As %String(MAXLEN = "", TRUNCATE = 1); Storage Default
{
<Data name="PATDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>CSRQ</Value>
</Value>
<Value name="3">
<Value>CYZZDBM</Value>
</Value>
<Value name="4">
<Value>CYZZDMC</Value>
</Value>
</Data>
<DataLocation>^M.PATD</DataLocation>
<DefaultData>PATDefaultData</DefaultData>
<IdLocation>^M.PATD</IdLocation>
<IndexLocation>^M.PATI</IndexLocation>
<StreamLocation>^M.PATS</StreamLocation>
<Type>%Library.CacheStorage</Type>
} }
 

Product version: Ensemble 2016.1
$ZV: Cache for Windows (x86-64) 2016.2.3 (Build 907_11_20446U) Thu Nov 12 2020 16:56:45 EST
Discussion (3)2
Log in or sign up to continue