: Alastair Donlon
>Sent: Tuesday, August 23, 2011 3:48 AM
>

> What’s the situation with support for xs:ID and xs:IDREF in
> generateDS? The documentation doesn’t mention them but it seems to
> work ok when attributes are references. However, if I want to allow
> a list of references the generated code doesn’t seem quite right.
> 
> This is an example of what I’m trying to support...
> 
> <mySet id=’setId1’/>
> <mySet id=’setId2’/>
> <mySet id=’setId3’>
>     <mySet>setId1</mySet>
>     <mySet>setId2</mySet>
> </mySet>

Alastair -

I believe that I have a solution, although it might not be the
solution you want.  It might not even be a solution to the right
problem.

But, see attached.

In the attached XML schema and sample XML instance document, as you
can see, I've defined two separate element types, whereas I believe
that you used only one.  The reason for this is that in your snippet
of XML (above) the element mySet can have either/both element
content and character content, that is, mixed content.  I've
separated those two roles, in part because generateDS.py generates
awkward code for elements with mixed content.  In my schema, the
element mySetRef (complexType mySetRefType) can have character
content, specifically the xs:IDREF or reference, and the element
mySet (complexType mySetType) can contain element content, and has
attribute "id", which is an xsID.

Would that solution work for you?

Hope you've had a good weekend.

- Dave



-- 


Dave Kuhlman
http://www.rexx.com/~dkuhlman

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to