[xsd-users] error processing multiple schemas at once
Boris Kolpackov
boris at codesynthesis.com
Mon Nov 7 08:39:59 EST 2011
Hi Eric,
Eric Broadbent <Eric.Broadbent at csr.com> writes:
> What I don't know how to do is separate the generated code from the
> built-in library interface, so that I can call the Expat parser myself.
Yes, this is possible. See Section 7.2, "Expat Document Parser" in the
"C++/Parser Mapping Getting Started Guide":
http://www.codesynthesis.com/projects/xsd/documentation/cxx/parser/guide/#7.2
> The generated pskel and pimpl code works well, but the standalone executable
> is almost 15MB (I built with validation on) and of course it brings in std::
> versions of utilities that already exist in the software environment that I
> want to plug the parser into. One example is simply malloc - we have our
> own system-wide malloc, and other services, and we call XML_ParserCreate_MMR
> to be able to utilize it.
C++/Parser in XSD doesn't allow this level of customization. It will
always use "standard C++" facilities where needed.
If you want to minimize external dependencies, then you may want to
consider XSD/e and its Embedded C++/Parser mapping, which is very
similar to C++/Parser. XSD/e is highly configurable, you can enable/
disable individual C++ features (like STL, iostream, exceptions, etc).
It also allows you to provide a custom memory allocator. In minimal
configuration it doesn't use much more than the basic C standard
library functions (strlen, memcpy, etc):
http://www.codesynthesis.com/products/xsde/
Boris
More information about the xsd-users
mailing list