Jump to content

Assign XSD to an element


Guest thiru

Recommended Posts

Hi All, I'm getting probelm with XSD schemas. I have two schemas say 1.xsd and 2.xsd.In 1.xsd schema I defined some complex type elements.In 2.xsd I am including the 1.xsd. Upto here fine.Now In 2.xsd I want to declare one complex type element under which I need 1.xsd elements.I can't declare a global variable in 1.xsd. I just declare all complex type elements in 1.xsd.ex:1.xsd<element name="one" type="one_type"/> <complexType name="one_type"> <some lements here> </complexType></element><element name="two" type="two_type"/> <complextype name="two_type"> <some elements here> </complexType></element>....................................in 2.xsd<include schemaLocation="1.xsd"><element name="root"> <complexType> <element name="root_first_child"/> <element name="root_second_child" (Under this element, I need all the elements declared in 1.xsd)/></complexType></element> How can I do this?Thanks in advance,-Thiru

Link to post
Share on other sites

I'm not that experienced with Schema yet, but I think including a schema is the same as to have it directly typed in there.So, perhaps something like this might help:

<element name="root_second_child"><complexType name="three_type"><element ref="one"/></complexType></element>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...