[xsd-users] Attempting to access attribute xml:base.

Jeroen N. Witmond jnw at xs4all.nl
Fri Dec 29 12:14:22 EST 2006


"Boris Kolpackov" <boris at codesynthesis.com> writes:

[snipped explanation about access to xml:base]

Thanks, I've got this to work in a test program, but I'm confused about
the code generated for xml.xsd. I used 'xsd cxx-tree --namespace-map
http://www.w3.org/XML/1998/namespace=XmlNamespace xml.xsd' and see that
the generated .cxx file does not contain any executable code, nor does the
generated .hxx file declare anything in namespace XmlNamespace.  Instead
all code related to xml:base is in the files generated from my own .xsd
file.

> If you want to allow say xml:base in all types in your schema then
> you may want to create a base type which includes only that attribute
> and then inherit all other types from it.

Unfortunately, I need to be able to access xml:base in code generated from
schemas I do not author, where the use of xml:base is covered by a
'<xs:anyAttribute namespace="##other"/>'.  So, instead of using a base
type in XML, I would need a base class in C++.  And unless I've missed
something, there is no way to tell xsd to generate its classes ': public
XmlNamespace' (for instance, where XmlNamespace is a class that implements
access to xml:base.).

[Snipped closed points.]

Kind regards,

Jeroen.





More information about the xsd-users mailing list