You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Paul Scruby <xm...@scruby.com> on 2003/04/23 19:46:06 UTC
Static library and XML dev question
Hi all,
Can anyone advise me how I can build a static Xecres-c library instead
of a shared one under Linux, because I couldn't find an option in the
build configuration?
My second question is not specific to Xecres and is more of a general
XML development question, but if anyone can help or point me in the
right direction I would be really grateful. I am developing an
application that has a bunch of internal data types stored in C++
classes. I have written a C++ wrapper library with Xecres to save and
load my internal classes to and from XML using SAX2. However, it is
becoming cumbersome to write wrapper classes to handle each element for
every internal class. Therefore, I have begun to think storing my data
in new classes that inherit DOMNodes so I do not need to write wrappers
to save and load XML. Can anyone recommend any sample code, or websites
for deriving data classes from DOMNodes and handling them with custom
DOMParsers? Maybe this is not such a good idea, and I am better
sticking to SAX2?
Many thanks,
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Static library and XML dev question
Posted by Peter Kryszkiewicz <ve...@attcanada.ca>.
I've had the same situation you're describing (deriving data classes from
DOMNodes) and tried the Java JAXB package with great success. I jump back
and forth between C++ and Java, whatever works best for the situation at
hand. I used the Java Data binding package (JAXB) to produce a general 3d
interface to a new web site I'm developing using Radiance, POVRay etc for
the 3d models. The 3d world stuff I put in an XML file and I use a Schema to
validate it. Now here's the neat part. The JAXB process builds classes and
datatypes from the Schema, and then writes the output to SVG and Java3D
(two of my output formats) in a pretty smooth fashion. In between I can do
all kinds of user input processing and so on. I'm not stuck on either C++ or
Java and will eventually convert my classes to C++ if performance issues get
in the way, but I find that Java is getting pretty good at
RAD for a start.
----- Original Message -----
From: "Doug Chinnery" <do...@zadall.com>
To: <xe...@xml.apache.org>
Sent: Wednesday, April 23, 2003 10:56 AM
Subject: Re: Static library and XML dev question
> Hey!
>
> => Can anyone advise me how I can build a static Xecres-c library instead
> => of a shared one under Linux, because I couldn't find an option in the
> => build configuration?
>
> 1) Do a build as you normally would.
> 2) cd to $ZERCESCROOT/obj/[platform]
> 3) run "ar r libxerces-c.a *.o
>
> => My second question is not specific to Xecres and is more of a general
> => XML development question, but if anyone can help or point me in the
> => right direction I would be really grateful. I am developing an
> => application that has a bunch of internal data types stored in C++
> => classes. I have written a C++ wrapper library with Xecres to save and
> => load my internal classes to and from XML using SAX2. However, it is
> => becoming cumbersome to write wrapper classes to handle each element for
> => every internal class. Therefore, I have begun to think storing my data
> => in new classes that inherit DOMNodes so I do not need to write wrappers
> => to save and load XML. Can anyone recommend any sample code, or
websites
> => for deriving data classes from DOMNodes and handling them with custom
> => DOMParsers? Maybe this is not such a good idea, and I am better
> => sticking to SAX2?
>
> That's a good question and one which I'm trying to discover myself.
> Lemme know if you get anywhere with this.
>
> Good luck.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Static library and XML dev question
Posted by Doug Chinnery <do...@zadall.com>.
Hey!
=> Can anyone advise me how I can build a static Xecres-c library instead
=> of a shared one under Linux, because I couldn't find an option in the
=> build configuration?
1) Do a build as you normally would.
2) cd to $ZERCESCROOT/obj/[platform]
3) run "ar r libxerces-c.a *.o
=> My second question is not specific to Xecres and is more of a general
=> XML development question, but if anyone can help or point me in the
=> right direction I would be really grateful. I am developing an
=> application that has a bunch of internal data types stored in C++
=> classes. I have written a C++ wrapper library with Xecres to save and
=> load my internal classes to and from XML using SAX2. However, it is
=> becoming cumbersome to write wrapper classes to handle each element for
=> every internal class. Therefore, I have begun to think storing my data
=> in new classes that inherit DOMNodes so I do not need to write wrappers
=> to save and load XML. Can anyone recommend any sample code, or websites
=> for deriving data classes from DOMNodes and handling them with custom
=> DOMParsers? Maybe this is not such a good idea, and I am better
=> sticking to SAX2?
That's a good question and one which I'm trying to discover myself.
Lemme know if you get anywhere with this.
Good luck.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Static library and XML dev question
Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi,
> My second question is not specific to Xecres and is more of a general
> XML development question, but if anyone can help or point me in the
> right direction I would be really grateful. I am developing an
> application that has a bunch of internal data types stored in C++
> classes. I have written a C++ wrapper library with Xecres to save and
> load my internal classes to and from XML using SAX2. However, it is
> becoming cumbersome to write wrapper classes to handle each element for
> every internal class. Therefore, I have begun to think storing my data
> in new classes that inherit DOMNodes so I do not need to write wrappers
> to save and load XML. Can anyone recommend any sample code, or websites
> for deriving data classes from DOMNodes and handling them with custom
> DOMParsers? Maybe this is not such a good idea, and I am better
> sticking to SAX2?
I would stick with the SAX solution although I am sure that either would
work. I don't think you need the overhead of a lot of the code in the
DOMParser. If you want to see an example of DOMNode derivation check out
the head of cvs of Pathan. We implement namespace node in just this way
although because they are created on the fly the parser does not change.
There is much experience on this list with parer changing so feel free ask
questions. You may encounter some problems with the memory management
model. For example, if you want to use the recycle functionality and
allocate memory from the same pool as xerces does for nodes you will need
to increase the number "15" in release and allocate in DOMDocumentImpl.
Gareth
--
Gareth Reakes, Head of Product Development +44-1865-203192
DecisionSoft Limited http://www.decisionsoft.com
XML Development and Services
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org