Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: change from om to xml library  (Read 9881 times)
Paul S.
Posts: 45


« 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
Frank G.
Four Js
Posts: 48


« Reply #1 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.

* doc.xml (0.17 KB - downloaded 956 times.)
Paul S.
Posts: 45


« Reply #2 on: September 12, 2011, 09:48:27 am »

Thanks , I will have a look.

Paul
Frank G.
Four Js
Posts: 48


« Reply #3 on: September 12, 2011, 11:04:42 am »

Sorry, I attached the wrong file. Here the good one :)

* xml.4gl (0.84 KB - downloaded 931 times.)
Paul S.
Posts: 45


« Reply #4 on: September 12, 2011, 11:26:37 am »

Thanks Again.

Paul
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines