473,387 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using IDREF and enumeration within Union

2
I'm trying to create a simple type that holds two different types. The first is IDREF and the second is an enumeration of string. When I generate a sample xml, I can enter any ID previously stated in the xml and validates correctly. When I try to use one of the enumeration in the drop down list, the xml will not validate.
When I validate the xml in xmlspy, i get the error message "IDREF 'endofprogam': referenced ID 'endofprogam' was not found."
Anyone knows a solution to having a union of enumeration and IDREF? I would appreciate any help.

<xs:simpleType name="Persist_Enum_Type">
<xs:annotation>
<xs:documentation>Persist gives the UTR multiple options of lifetime</xs:documentation>
</xs:annotation>
<xs:union memberTypes="xs:IDREF">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:annotation>
<xs:documentation>
End of Program (EOP)
End of Children (EOC)
End of Lifetime (EOL)
Persist to Label (PTL)
</xs:documentation>
</xs:annotation>
<xs:enumeration value="endofprogram"/>
<xs:enumeration value="endofchildren"/>
<xs:enumeration value="endoflifetime"/>
<xs:enumeration value="persisttolabel"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
May 18 '07 #1
1 2147
Dököll
2,364 Expert 2GB
I'm trying to create a simple type that holds two different types. The first is IDREF and the second is an enumeration of string. When I generate a sample xml, I can enter any ID previously stated in the xml and validates correctly. When I try to use one of the enumeration in the drop down list, the xml will not validate.
When I validate the xml in xmlspy, i get the error message "IDREF 'endofprogam': referenced ID 'endofprogam' was not found."
Anyone knows a solution to having a union of enumeration and IDREF? I would appreciate any help.

Expand|Select|Wrap|Line Numbers
  1. <xs:simpleType name="Persist_Enum_Type">
  2. <xs:annotation>
  3. <xs:documentation>Persist gives the UTR multiple options of lifetime</xs:documentation>
  4. </xs:annotation>
  5. <xs:union memberTypes="xs:IDREF">
  6. <xs:simpleType>
  7. <xs:restriction base="xs:string">
  8. <xs:annotation>
  9. <xs:documentation>
  10. End of Program (EOP)
  11. End of Children (EOC)
  12. End of Lifetime (EOL)
  13. Persist to Label (PTL)
  14. </xs:documentation>
  15. </xs:annotation>
  16. <xs:enumeration value="endofprogram"/>
  17. <xs:enumeration value="endofchildren"/>
  18. <xs:enumeration value="endoflifetime"/>
  19. <xs:enumeration value="persisttolabel"/>
  20. </xs:restriction>
  21. </xs:simpleType>
  22. </xs:union>
  23. </xs:simpleType>
  24.  
Hopefully you're still looking for this...

I sounds like MSXML.NET validates XML a bit better than XMLSpy. I am not sure how accurate this is, but I say give it a whirl. It was suggested that a good way to write it would be:

Expand|Select|Wrap|Line Numbers
  1. <union>
  2. <simpleType of enumeration>
  3. <simpleType of IDREF>
  4. </union>
  5.  
Hope this helps!
Jul 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Nicolas Bouillon | last post by:
Hi I am writing a schema and i want to have an element's attribute, which is an IDREF to an other type of element. For example <Type1 id="id1"/> <Type2 id="id2"/>
10
by: Christopher Benson-Manica | last post by:
Why can't I use a class destructor in a using declaration: using MyClass::~MyClass; ? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org ...
5
by: Stuart Robertson | last post by:
I am trying to find a solution that will allow me to use XmlSerializer to serialize/deserialize a collection of objects where a given object is shared between two or more other objects, and not...
27
by: Ben Finney | last post by:
Antoon Pardon wrote: > I just downloaded your enum module for python > and played a bit with it. IMO some of the behaviour makes it less > usefull. Feedback is appreciated. I'm hoping to...
13
by: Kantha | last post by:
Hi all, I have declared an Union as follows typedef union { struct interrupt_bits { unsigned char c_int_hs_fs_status : 1, c_setup_intflag : 1,
2
by: jacquesh | last post by:
HI all I'm looking for different ways to using idref with more than one XML file ?? My case :: 2 xml files {labo.xml, contact.xml} I found a method which use an include via '<!ENTITY...'...
3
by: Eric Lilja | last post by:
Sorry for asking so many questions, but I've just started and need to get some things working so I can do the task that is before me. Consider this (validating) schema: <?xml version="1.0"?>...
0
by: varun aggarwal | last post by:
Hi i am very new to XML ( just started yesterday). I am confused that how can IDREF will know which ID to refer to for example <!ELEMENT take1 (takeID1)> <!ELEMENT takeID1 EMPTY> <!ATTLIST...
2
by: Luigi | last post by:
Hello! I'm writing a schema where an element has got a reference to another element via IDREF. The problem is that I would restrict the possible references to the sole elements of a specific...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.