[xsd-users] Accessors for sequences

Boris Kolpackov boris at codesynthesis.com
Wed Jun 4 03:54:21 EDT 2008


Hi Manav,

Manav Rathi <manav.rathi at incainformatics.com> writes:

> 1. I am using xsd-3.1.0-i686-windows. If I just pop in the new binary to the
> bin directory, will it work (or do I need to replace the entire directory
> tree). I ask this because it'll be extremely difficult for me to replace
> upgrade the entire xsd tree (multiple developers + source safe + this not
> being a stable version).
> 
> (Note: It seems to work. I just want your sanction)

Yes, I checked the difference between 3.1.0 and 3.1.1.a5 in libxsd
and it should be possible to use the XSD binary from 3.1.1.a5 with
the runtime from 3.1.0.


> 2. This is what I am using (ditto for modifiers).
> --seq-accessor-regex "/(\w+?\b)/$1s/" 
> --seq-accessor-regex "/(\w+?s\b)/$1_s/"
> There are two regexes so that names ending with s are prefixed with _s.
> Is this okay?

Yes, this should do it (I don't think \b is really necessary).


> 3. The docs say "...After the initial name component, up to two additional
> name components can be present, separated by commas." 
> What are these, and should I worry about them?

In certain situations XSD needs to generate compound names that
don't come from the schema. For example, any_attribute for the
anyAttribute wildcards. It passes such names to the regex as
any,attribute to allow you to transform them (e.g., any_attribute,
anyAttribute, getAnyAttribute, etc). However, there are no such
compound names passed to the --seq-* regex so you don't need to
worry about them. 


> 4. Offtopic. I noticed that the binary itself is ~ 21 MB. That's huge
> (although it is not a problem). Is it because of templates, or are you
> statically linking to something, or is it just that big. Just curious.

The binary is statically linked to everything except the C runtime
(that includes Xerces-C++, Boost, C++ runtime, etc.). This way you
can use it on any machine. It also contains the symbol information
(though no debug information) so that if the compiler crashes and
dumps core one can view and report the stack trace. However since
there is no concept of core on Windows, it does not make much sense
to keep the symbols around and we should strip them for this platform.
The stripped Windows binary is 9MB.

Boris




More information about the xsd-users mailing list