Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Paul S. on September 10, 2011, 08:29:13 pm



Title: change from om to xml library
Post by: Paul S. on September 10, 2011, 08:29:13 pm
With the om version of a DomNode , you could use TypeInfo and domnode.writexml to create a qucik XML dump. This
worked great for array's as well. see code below

I want to repeat this feature using the xml.domnode and xmlDomDocument, I have tried a number of ways using
xml.Serializer.Variableto dom . but cannot get it to work, any ideas?

Thanks

Paul

01 MAIN
02   DEFINE n om.DomNode
03   DEFINE r RECORD
04       key INTEGER,
05       lastname CHAR(20),
06       birthdate DATE
07   END RECORD
08   LET r.key = 234
09   LET r.lastname = "Johnson"
10   LET r.birthdate = MDY(12,24,1962)
11   LET n = base.TypeInfo.create( r )
12   CALL n.writeXml( "r.xml" )
13 END MAIN


Title: Re: change from om to xml library
Post by: Frank G. on September 12, 2011, 09:40:42 am
Hi,

  The xml serializer will serialize any 4GL variable as child node of a given dom node. This implies that you must first create a child node where to attach the resulting conversion. If you don't need a real dom node, you can create a document fragment node, and then append it where you want in the XML tree.

See attached sample. Notice also that you can set attributes to change the default way to serialize the 4GL record.


Title: Re: change from om to xml library
Post by: Paul S. on September 12, 2011, 09:48:27 am
Thanks , I will have a look.

Paul


Title: Re: change from om to xml library
Post by: Frank G. on September 12, 2011, 11:04:42 am
Sorry, I attached the wrong file. Here the good one :)


Title: Re: change from om to xml library
Post by: Paul S. on September 12, 2011, 11:26:37 am
Thanks Again.

Paul