OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Create XML

[ Lists Home | Date Index | Thread Index ]

Title: Message
I didn't mention it for simplicity, but I would use a string, a loop, *and* an xmlEncode() function.
 
PJDM
--
Peter Mayne
Technology Consultant
Spherion Technology Solutions
Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602
T: 61 2 62689727  F: 61 2 62689777
-----Original Message-----
From: Dare Obasanjo [mailto:dareo@microsoft.com]
Sent: Friday, 13 June 2003 10:26 AM
To: Mayne, Peter; xml-dev@lists.xml.org
Subject: RE: [xml-dev] Create XML

Products that use string functions to produce XML are notorious for failing unexpectedly and in annoying ways. If only I had a penny for every time someone used printf to write out an XML file only to get bitten by placing ' or & unescaped into content.
 

--
PITHY WORDS OF WISDOM
Beauty is skin deep but ugly goes to the bone.                                              

This posting is provided "AS IS" with no warranties, and confers no rights.

 


From: Mayne, Peter [mailto:PeterMayne@ap.spherion.com]
Sent: Thursday, June 12, 2003 4:44 PM
To: xml-dev@lists.xml.org
Subject: RE: [xml-dev] Create XML

> -----Original Message-----
> From: Emmanuil Batsis (Manos) [mailto:mbatsis@netsmart.gr]
> Sent: Friday, 13 June 2003 1:42 AM
> To: Mehmet AVSAR; xml-dev@lists.xml.org
> Subject: Re: [xml-dev] Create XML
>
>
> You should use an XML API to create/manipulate XML documents
> instead of raw string manipulation.

Why? No, seriously.

For small/simple XML documents such as the OP's, I tend to use a for loop and a few print statements (mod your favourite language) rather than dragging in XML libraries and adding more complicated code.

An obvious argument for using an XML API is the guarantee (?) of correct XML at the end. But for simple XML, it's not hard to do it with a string and a loop (or a string template and a replace) and get the same result.

I'm certainly not advocating that using XML APIs to create documents is stupid, but surely there's a crossover point where the simplicity of the result doesn't justify the added complexity of an XML API compared to just building a string?

Or have I just committed heresy? :-)

PJDM
--
Peter Mayne
Technology Consultant
Spherion Technology Solutions
Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602
T: 61 2 62689727  F: 61 2 62689777

The information contained in this email and any attachments to it:

(a) may be confidential and if you are not the intended recipient, any interference with, 
use, disclosure or copying of this material is unauthorised and prohibited; and

(b) may contain personal information of the recipient and/or the sender as defined 
under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to 
collect, hold and use such information and any personal information contained in a 
response to this email, for any reasonable purpose in the ordinary course of 
Spherion's 
business, including forwarding this email internally or disclosing it to a third party. All 
personal information collected by Spherion will be handled in accordance with 
Spherion's Privacy Policy. If you have received this email in error, please notify the 
sender and delete it.

(c) you agree not to employ or arrange employment for any candidate(s) supplied in 
this email and any attachments without first entering into a contractual agreement with 
Spherion. You further agree not to divulge any information contained in this document 
to any person(s) or entities without the express permission of Spherion.






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS