|
Re: Schema default value not honored for complex type [message #906559 is a reply to message #906527] |
Sat, 01 September 2012 21:31 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Derek,
Please use the Web Tools forum to ask questions about the Eclipse
XML/XSD tools. This form is for asking questions about the XSD API.
On 01/09/2012 9:32 PM, Derek Wallace wrote:
> Hi,
> I have a simple schema.
> I have some elements with simple type and an element as a complex type. The complex type consists of a number of simple type elements.
>
> All elements have a default value.
>
> When i use the Outline view in Eclipse to add elements, the default value is honored for simple types but not for the elements in the complex type.
>
> Ive attached the .xml file and the .xsd.
>
> If i use File - New - Other - XML and follow the wizard to create the initial .xml based on the schema, it adds the elements (simple and complex) and the default of the simple and complex types are honored.
>
> here is how thie file first looks.
> <?xml version="1.0" encoding="UTF-8"?>
> <del:bookstore xmlns:del="xxxxdel" xmlns:xsi="xxxxXMLSchema-instance" xsi:schemaLocation="xxxxxdel example2.del.xsd ">
> <del:Simple>789</del:Simple>
> <del:SimpleList>DSSEA</del:SimpleList>
> <del:Complex>
> <del:Age>39</del:Age>
> <del:Color>White</del:Color>
> </del:Complex>
> </del:bookstore>
>
>
> If i now manually add a 2nd instance of the Simple type (via the Outline window, righ click, add after, Simple) it is correct.
> <?xml version="1.0" encoding="UTF-8"?>
> <del:bookstore xmlns:del="xxxxdel" xmlns:xsi="xxxxXMLSchema-instance" xsi:schemaLocation="xxxxdel example2.del.xsd ">
> <del:Simple>789</del:Simple>
> <del:Simple>789</del:Simple>
> <del:SimpleList>DSSEA</del:SimpleList>
> <del:Complex>
> <del:Age>39</del:Age>
> <del:Color>White</del:Color>
> </del:Complex>
> </del:bookstore>
>
>
> If i now manually add a 2nd instance of the Complex type (via the Outline window) it is NOT correct.
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <del:bookstore xmlns:del="xxxx/del" xmlns:xsi="xxxxXMLSchema-instance" xsi:schemaLocation="xxxxxdel example2.del.xsd ">
> <del:Simple>789</del:Simple>
> <del:Simple>789</del:Simple>
> <del:SimpleList>DSSEA</del:SimpleList>
> <del:Complex>
> <del:Age>39</del:Age>
> <del:Color>White</del:Color>
> </del:Complex>
> <del:Complex>
> <del:Age>del:Age</del:Age>
> <del:Color>del:Color</del:Color>
> </del:Complex>
> </del:bookstore>
>
>
> Im using Eclipse Helios.
> Version: 3.7.1
> Build id: M20110909-1335
>
> Thx
> Derek
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02709 seconds