|
|
|
Re: How to generate XSD from XML, by restricting all the values ? [message #903311 is a reply to message #903308] |
Thu, 23 August 2012 06:32 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Sagar,
A -inst2xsd option isn't part of the XSD project. Is this something
provided by Web Tools ore something external to Eclipse? I imagine a
schema generator tool will try to create a general schema that allows
more than just the one specific instance...
On 23/08/2012 8:15 AM, sagar y wrote:
> Hi Ed Merks,
>
> Since i can restrict values by enumeration too,
> I tried using int2xsd by giving enumeration attribute ,
>
> inst2xsd -enumerations 1
>
> but it generates XSD with enumeration to elements which have more than
> 1 different(at min.)
> I do not get enumeration for elements which take only one value.
>
> say My XML is
>
> <ITRForm:Section80GGA>2500</ITRForm:Section80GGA>
> <ITRForm:Section80GGC>3500</ITRForm:Section80GGC>
> <ITRForm:Section80U>1500</ITRForm:Section80U>
>
>
> <ITRForm:DoneePAN>SomePan11111</ITRForm:DoneePAN>
> <ITRForm:AddressDetail>
> <ITRForm:AddrDetail>SomePlace1111</ITRForm:AddrDetail>
> <ITRForm:DoneePAN>SomePan22222</ITRForm:DoneePAN>
> <ITRForm:AddressDetail>
> <ITRForm:AddrDetail>SomePlace2222</ITRForm:AddrDetail>
> XSD is created as,
>
>
> <xs:element name="Section80GGA" type="xs:integer"/>
> <xs:element name="Section80GGC" type="xs:integer"/>
> <xs:element name="Section80U" type="xs:integer"/>
>
> <xs:element name="AddrDetail">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:enumeration value="SomePlace1111"/>
> <xs:enumeration value="SomePlace2222"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
>
> I need enumeration for Section80GGA,Section80GGC,Section80U too.
>
> Other option is generating fixed="" attribute for elements.
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03408 seconds