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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...