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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...