468,321 Members | 1,809 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

xs:extension problem

3
Hi again,

I feel like I'm spamming the place, but these are all the things that I encounter during work.
Anyways:
I made a base complex type:
Expand|Select|Wrap|Line Numbers
  1. <xs:complexType name="BaseLocationType">
  2.         <xs:sequence>
  3.             <xs:element name="Path" type="xs:string" maxOccurs="1" minOccurs="1" />
  4.             <xs:element name="Files" type="xs:string" minOccurs="0" maxOccurs="1" />
  5.         </xs:sequence>
  6.     </xs:complexType>
Which I want to extend to define other more specific locations. Like for example:
Expand|Select|Wrap|Line Numbers
  1. <xs:complexType name="LocalDiskType">
  2.         <xs:complexContent>
  3.             <xs:extension base="BaseLocationType">
  4.                 <xs:sequence>
  5.                     <xs:element name="Drive" type="xs:string" minOccurs="1" maxOccurs="1" />
  6.                 </xs:sequence>
  7.             </xs:extension>
  8.         </xs:complexContent>        
  9.     </xs:complexType>
This means that I'm defining my second type and it is derived from my first type. It only adds another element to the type (beeing <Drive>)

If I'm doing something wrong here or if my logic is false, please tell me.

But as far as I can interprete the documentation that I read this should work. This would also imply that I can use this element as follows:
Expand|Select|Wrap|Line Numbers
  1. <Location>
  2.     <LocalDisk>
  3.         <Path></Path>
  4.         <Drive>C</Drive>
  5.     </LocalDisk>
  6. </Location>
Were it not that VS 2003 gives me an error on path, because it's not defined in my xsd according to VS2003.

BUT! Very important! If I leave the <Path> tag out, VS2003 complains because it was expecting a <Path> tag.

I don't know why he does that, but I would love to have a solution that is clean.

Greetings,
- SL33PY
May 10 '06 #1
0 927

Post your reply

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

Similar topics

5 posts views Thread by Jeffry van de Vuurst | last post: by
4 posts views Thread by Mike Jansen | last post: by
3 posts views Thread by SideByEach | last post: by
2 posts views Thread by randar | last post: by
3 posts views Thread by Amol | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by howard w | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.