Julius is an Avid Commentator
76 published comments for 2024
User bio
404 bio not found
Member since Jul 25, 2017
Replies:
Class DC.Bundle Extends (%RegisteredObject, %XML.Adaptor)
{
Property Entries As list Of Entry(XMLNAME = "Entry", XMLPROJECTION = "ELEMENT");

ClassMethod Test()
{
	s bnd=..%New()
	s ent=##class(Entry).%New(),ent.Name="John",ent.Age=40 d bnd.Entries.Insert(ent) k ent
	s ent=##class(Entry).%New(),ent.Name="Paul",ent.Age=45 d bnd.Entries.Insert(ent) k ent
	
	d bnd.XMLExportToString(.xx) q xx
}
}

Class DC.Entry Extends (%RegisteredObject, %XML.Adaptor)
{
Property Name As %String;
Property Age As %Integer;
}

The test output is:


USER>set xml=##class(DC.Bundle).Test()

USER>write xml
<Bundle><Entry><Name>John</Name><Age>40</Age></Entry><Entry><Name>Paul</Name><Age>45</Age></Entry></Bundle>
USER>

USER>zzxs xml
<Bundle>
    <Entry>
        <Name>John</Name>
        <Age>40</Age>
    </Entry>
    <Entry>
        <Name>Paul</Name>
        <Age>45</Age>
    </Entry>
</Bundle>

USER>
Certifications & Credly badges:
Julius has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Following:
Julius has not followed anybody yet.