XML Schema --> C++

KenB KenB at bristol.com
Thu Jan 20 14:03:05 GMT 2000


We just finished the first release of a product to help with this problem.
http://www.bristol.com/exactml

It did turn out to be a much bigger undertaking that we originally estimated.
Especially because we chose to support both DTDs and the draft schema
spec from the outset.  We had to write a complete DTD parser for the reasons
outlined below.  Was not a monumental effort, but not trivial either.

--ken

---------------------- Forwarded by KenB/Bristol Technology on 01/20/2000 09:04
AM ---------------------------
                                                                  
 (Embedded                                                        
 image moved   "Abhishek Srivastava" <abisheks at india.hp.com>      
 to file:      01/20/2000 06:05 AM                                
 pic32485.pcx)                                                    
                                                                  



Please respond to "Abhishek Srivastava" <abisheks at india.hp.com>
                                                              
                                                              
                                                              
 To:      xml-dev at ic.ac.uk                                    
                                                              
 cc:      (bcc: KenB/Bristol Technology)                      
                                                              
                                                              
                                                              
 Subject: Re: XML Schema --> C++                              
                                                              






I also want to auto generate code of a c++ class that could contain the data
of an XML file.
I tried to create one but found it very complex as the DTD can have

1. any level of nested elements and aggregates.
2. Elements and attributes can optional.
3. The OR conditions that are specified in the DTD.

Is it possible we have something like a IDL compiler ? the idl compiler
reads the IDL file and generates C++ classes that can be used to implement
that object. Can a utility read a DTD or a schema and auto generate the code
for a C++ class.

This utility will be very useful, as many legacy systems do not understand
the DOM tree or xml... so in order to reuse the legacy code the data from
the dom tree needs to be put in a regular c++ object and fed to the legacy
system and the output from a C++ object converted to xml and then sent over
the web.

If an effort is started to write such a utility what other complexities
might arise ?

regards,
Abhishek.

----- Original Message -----
From: "Jean Marc VANEL" <jean-marc_vanel at effix.fr>
To: <xml-dev at ic.ac.uk>; <xml-dev-ig%PMDF%MHMAIL at mr.effix.fr>; "tcs-infra"
<tcs-infra at effix.fr>; "Madjid OUTENAH" <m_outenah at effix.fr>;
<s_durfort at mailhub.effix.fr>; <j_lolieux at mailhub.effix.fr>;
<f_clerc at mailhub.effix.fr>; <thomas_moutel at effix.fr>; <d_asseline at effix.fr>;
<guy_dauchet at effix.fr>; "Sonia BILLINGS" <s_billings at effix.fr>
Sent: Thursday, January 20, 2000 3:12 PM
Subject: XML Schema --> C++


>
>
> Hello
>
> I want to try to generate C++ class declarations from an XML Schema .
>
> Something like:
>
> <template select = '//type' >
>   class <value-of select="@name"/> {
>    <apply-templates/>
>   };
> </template>
>
> <template select = '//element' >
>   <value-of select="@type"/> <value-of select="@name"/> ;
> </template>
>
> Remarks:
> - not yet tested
> - as writen this would generate embeded classes
> - ID's and IDREF's would map to void* and list<void*>
> - same principle could be applied to Java etc
> - it is desirable to also generate code to fill the C++ objects using DOM
or SAX API, but it seems more difficult
> - it's also possible (another project!) to parse C++ declarations and
generate an XML Schema ; could a round-trip be possible ?
>
>
>
> xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
> Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ or CD-ROM/ISBN
981-02-3594-1
> Please note: New list subscriptions now closed in preparation for transfer
to OASIS.
>
>


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ or CD-ROM/ISBN
981-02-3594-1
Unsubscribe by posting to majordom at ic.ac.uk the message
unsubscribe xml-dev  (or)
unsubscribe xml-dev your-subscribed-email at your-subscribed-address

Please note: New list subscriptions now closed in preparation for transfer to
OASIS.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: att1.eml
Type: application/octet-stream
Size: 4916 bytes
Desc: not available
Url : http://mailman.ic.ac.uk/pipermail/xml-dev/attachments/20000120/5119d1fa/att1.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic32485.pcx
Type: application/octet-stream
Size: 2427 bytes
Desc: not available
Url : http://mailman.ic.ac.uk/pipermail/xml-dev/attachments/20000120/5119d1fa/pic32485.obj


More information about the Xml-dev mailing list