[xsd-users] New user has trouble getting some of the data out of doxygen-generated xml.

Boris Kolpackov boris at codesynthesis.com
Wed Jun 29 13:36:05 EDT 2011


Hi Cristiano,

Cristiano Di Buduo <cristiano_di_buduo at hotmail.com> writes:

> One is that i have two .xsd files which need interface classes, but 
> they both define the type "DoxygenType", which results in duplicate
> identifier errors in the generated code. I tried to put them into
> separate namespaces, but that caused a whole new bunch of problems.

Separate namespaces are the best solution. Simply add

--namespace-map =schema1

when compiling the fist schema and

--namespace-map =schema2

when compiling the second schema. There should be no problems, at
least not in the generated code.



>    //cout<<k->type()<<endl; // Doesn't work
>    //cout<<k->argsstring()<<endl;  // Doesn't work
>
> [...]
>
> You'll notice i passed keep_dom. I tried to get the value through _node.
> The DOMNode's there, as i verified its node name to be correct, but
> getting the node value returns null, even though there's a value in
> the xml.

The 'type' element above is of mixed content and 'argstring' is of
anyType so there is no representation for them in the object model.
You were on the correct path when you tried to use the underlying
DOM. The value must be there (it is a DOMText node which is a child
of DOMElement that you are getting). Check some of the examples that
show how to get it (e.g., 'mixed').

Alternatively, you can fix the schema to assign some sane types
to these element (e.g., string).

Boris



More information about the xsd-users mailing list