[xsd-users] error processing multiple schemas at once

Eric Broadbent eric.broadbent at csr.com
Thu Nov 10 14:06:27 EST 2011


Hi Boris,
when I built XSDE, many serialization files were built - whether or not I set  "XSDE_SERIALIZER_VALIDATION" on or off in config..make
(Here's a partial listing of the compiles with XSDE_SERIALIZER_VALIDATION := n")

	g++  -I.. -W -Wall -O3 -c cxx/serializer/elements.cxx -o cxx/serializer/elements.o
	g++  -I.. -W -Wall -O3 -c cxx/serializer/context.cxx -o cxx/serializer/context.o
	g++  -I.. -W -Wall -O3 -c cxx/serializer/genx/document.cxx -o cxx/serializer/genx/document.o
	g++  -I.. -W -Wall -O3 -c cxx/serializer/genx/xml-error.cxx -o cxx/serializer/genx/xml-error.o
	g++  -I.. -W -Wall -O3 -c cxx/serializer/exceptions.cxx -o cxx/serializer/exceptions.o
	g++  -I.. -W -Wall -O3 -c cxx/serializer/non-validating/serializer.cxx -o cxx/serializer/non-validating/serializer.o
	g++  -I.. -W -Wall -O3 -c cxx/serializer/non-validating/time-zone.cxx -o cxx/serializer/non-validating/time-zone.o
	g++  -I.. -W -Wall -O3 -c cxx/serializer/non-validating/xml-schema-sskel.cxx -o cxx/serializer/non-validating/xml-schema-sskel.o
	<... 40 lines skipped ...>
	g++  -I.. -W -Wall -O3 -c cxx/serializer/non-validating/date-time.cxx -o cxx/serializer/non-validating/date-time.o
	g++  -I.. -W -Wall -O3 -c cxx/serializer/non-validating/duration.cxx -o cxx/serializer/non-validating/duration.o


I was operating with the understanding that serialization is optional - but perhaps that's only when schema-compilation is run (after XSDE is built).
The chapter on Serialization (http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#4) indicates:

"Note that the generation of the serialization code is optional and should be explicitly requested with the --generate-serialization option."

Secondly, in the software that XSDE will be linked into, Expat exists already.
Instead of having the XSDE build process compile another instance of Expat, is it possible for me to just point the XSDE library at the existing build?
(Assuming they are the same release of Expat which they are)

Thanks again for your help - sorry for all the questions.

-Eric


On Nov 7, 2011, at 11:38 AM, Eric Broadbent wrote:

> Hi Boris - indeed it looks like XSD/e is what I should be looking at.
> The software system that consumes the XML is in fact an embedded system - I just didn't know that there was an XSD implementation designed for this.
> I will transition to using that in my next iteration - and thanks so much for your help and advice.
> 
> -Eric B.
> 
> On Nov 7, 2011, at 8:39 AM, Boris Kolpackov wrote:
> 
>> 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
>> 
>> 
>> To report this email as spam click https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg== .
> 
> 
> 
> Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
> More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
> 




More information about the xsd-users mailing list