🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.xml
4 messages
4 total messages Started by Tom Conlon Sun, 08 Jun 2008 20:27
Basic Q - archiving master & child db records
#181
Author: Tom Conlon
Date: Sun, 08 Jun 2008 20:27
17 lines
1477 bytes
Hi,

I'm looking to save master record and mutiple related child records from 
multiple child tables for archiving purposes to xml.

Some Q's:
1. Would you recommend using attributes for field names or elements? (sorry 
if this has been answered many times in the past).
2. Regarding string/varchar data - does these need to be encoded prior to 
saving? (ie. every field)
3. Regarding text blob data - does these need to be encoded prior to saving?
or do people use CDATA instead?

Any other tips/links especially welcome (esp. delphi-specific).

Thanks,
Tom 
Re: Basic Q - archiving master & child db records
#182
Author: Mikael Eriksson
Date: Mon, 09 Jun 2008 07:48
33 lines
1853 bytes
Tom Conlon skrev:
> Hi,
> 
> I'm looking to save master record and mutiple related child records from 
> multiple child tables for archiving purposes to xml.
> 
> Some Q's:
> 1. Would you recommend using attributes for field names or elements? (sorry 
> if this has been answered many times in the past).
> 2. Regarding string/varchar data - does these need to be encoded prior to 
> saving? (ie. every field)
> 3. Regarding text blob data - does these need to be encoded prior to saving?
> or do people use CDATA instead?
> 
> Any other tips/links especially welcome (esp. delphi-specific).
> 
> Thanks,
> Tom 
> 
> 

Hi!

Here is what I would do.

1. Elements
2. No (If the xml is encoded with utf-8 it takes care of any odd 
characters like ���)
3. Base64 encode the blob data

regards

/MIcke
Re: Basic Q - archiving master & child db records
#183
Author: Tom Conlon
Date: Tue, 10 Jun 2008 08:05
9 lines
1171 bytes
Thanks for the reply Mikael.

> 2. No (If the xml is encoded with utf-8 it takes care of any odd 
> characters like ���)

What if some data has & (or ",', <, >, etc)  in it? Wouldn't this cause 
problems later?

Tom 
Re: Basic Q - archiving master & child db records
#184
Author: Mikael Eriksson
Date: Wed, 11 Jun 2008 13:08
13 lines
1409 bytes
Tom Conlon skrev:
> What if some data has & (or ",', <, >, etc)  in it? Wouldn't this cause 
> problems later?
> 
> Tom 

If you build the xml yourself concatenating strings you have to convert 
those to entities. Function HTMLEncode in HTTPApp.pas does that for you.

If you use the interface IXMLDocument to build the xml it is taken care 
of for you when you assign a value to the node.

/Micke
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads