Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Export Template

Status
Not open for further replies.

TinLegs

Programmer
Jan 14, 2003
100
NZ
Clarion 6.1 - ABC - Using the Clarion embed 'ToXML - Export a structure to XML' template is there a way I can force it to create an XML file for the selected record only rather than it create an XML file that includes all records?

Thanks
 
Hi!

I have never used that template - I use the free iqXML ( or xFiles from Capesoft (
Are you talking about the code template "ExportToXML"? If so, I am assuming your data origin is a TABLE (FILE). Since the Data Origin can be GROUP, you could try setting the Table's Record i.e. <FilePrefix>:Record as the data origin. Of course, this would exclude all MEMO's & BLOB's in the Table. The other option is to create a local queue, set that queue as the data origin and copy the required records to the queue before the call to export.

Regards
 
Thanks ShankarJ

Yes sorry, I am using the ExportToXML template. I am trying to export all the fields including Memo's of a single selected record only to an XML file from a browse.

The template works fine for exporting all records including Memo's.

I have had a play with the Queue idea and it appears to work fine for exporting a single record but my only problem now is that I have two large MEMO fields that I wish to export to XML also, can this be done?

As you can see when it come to Queue's I am still in the Queue waiting to learn about them.
 
Hi!

You could define STRING() variables in your Queue for the MEMO's. If you want to optimize the size of the queue, you can use dynamic strings but you have to be careful and dispose them after use to avoid memory leaks. An example is ::

MyFileQueue QUEUE(FIL:Record),PRE(MyQ)
Memo1 &STRING
Memo2 &STRING
END

FREE(MyFileQueue)

CLEAR(MyFileQueue)

Size# = LEN(CLIP(FIL:Memo1)) + 1
MyQ:Memo1 &= NEW(STRING(Size#))

Size# = LEN(CLIP(FIL:Memo2)) + 1
MyQ:Memo2 &= NEW(STRING(Size#))

... queue assignments ...

MyFileQueue :=: FIL:Record
MyQ:Memo1 = FIL;Memo1
MyQ:Memo2 = FIL;Memo2

ADD(MyFileQueue)

... call template here to export queue ...

GET(MyFileQueue, 1)

DISPOSE(MyQ:Memo1) ; MyQ:Memo1 &= NULL
DISPOSE(MyQ:Memo2) ; MyQ:Memo2 &= NULL

PUT(MyFileQueue)

FREE(MyFileQueue)


Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top