Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Creating XML data files

Reply
Thread Tools

Creating XML data files

 
 
jmm-list-gn
Guest
Posts: n/a
 
      08-21-2004
Hello,
I am new to XML. One of the aspects in studying how XML documents are
manipulated is the assumption that XML data files spring spontaneously
into existence. Are all XML data files really handwritten?
I am working on a program that queries a package carrier's web service
about shipping rates. They have provided a number of XML schema (.xsd).
Creating a XML query packet, however, seems to require having the element
tags in the program as strings, and the wrapping them around the data as
required. That is, an automated form of handwriting the XML file.
Is this normally how it is done?
Is there some way to use the schema files to get the appropriate tags
rather than have them written into the program?

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
 
Reply With Quote
 
 
 
 
Stefan Ram
Guest
Posts: n/a
 
      08-21-2004
jmm-list-gn <(E-Mail Removed)> writes:
>Creating a XML query packet, however, seems to require having the element
>tags in the program as strings, and the wrapping them around the data as
>required. That is, an automated form of handwriting the XML file.
> Is this normally how it is done?


One can do so, or one might create a document model in memory
(a "DOM") and use a library to write it, or one might use a
library for writing XML.

Writing XML is much simplier than reading XML, because the
author of an XML document can chose what to write, while a
parser must be able to cope at any time with everything that
is possible in XML, actually even with everything that is
not possible, because the parser should also emit nice
error reports in such a case.

What is needed most often, when writing XML, is a subroutine
to replace special characters occuring in text (such as "<")
by a representation (such as "<"). When it gets the job
done, there is nothing wrong with just a "PRINT '<EXAMPLE>';"
to start an element. When certain patterns of such PRINT-
statements repeat in source code, one will start to catch them
as subroutines.


 
Reply With Quote
 
 
 
 
Ed Day
Guest
Posts: n/a
 
      08-23-2004
jmm-list-gn <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Hello,
> I am new to XML. One of the aspects in studying how XML documents are
> manipulated is the assumption that XML data files spring spontaneously
> into existence. Are all XML data files really handwritten?
> I am working on a program that queries a package carrier's web service
> about shipping rates. They have provided a number of XML schema (.xsd).
> Creating a XML query packet, however, seems to require having the element
> tags in the program as strings, and the wrapping them around the data as
> required. That is, an automated form of handwriting the XML file.
> Is this normally how it is done?
> Is there some way to use the schema files to get the appropriate tags
> rather than have them written into the program?


You might want to look into XML Data Binding applications. They can
generate code from a given XSD specification to serialize/deserialize
program data to and from XML. A Google search of "XML Data Binding"
will provide more information on these tools.

Regards,

Ed Day
Objective Systems, Inc.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Announce] Stylus Studio 2007 XML Enterprise Suite Released: XML Pipeline, XML Publishing and Data Conversion API's stylusstudio@gmail.com Java 0 09-26-2006 05:04 PM
[ANN] Stylus Studio 2007 XML Enterprise Suite Released: XML Pipeline, XML Publishing and Data Conversion API's Stylus Studio XML 0 09-26-2006 04:49 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Tools to extract data from SQL database and convert it into XML & insert XML data into SQL databases Harry Zoroc XML 1 07-12-2004 10:10 PM
ASP XML Support - Generate XML string from FORM DATA based on XML schema Matt ASP General 3 04-23-2004 07:12 PM



Advertisments