Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346128 - [content model] New XML Wizard creates invalid value for gMonth data type
Summary: [content model] New XML Wizard creates invalid value for gMonth data type
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xsd (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Salvador Zalapa CLA
QA Contact: Keith Chong CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 13:40 EDT by Andrea Rice CLA
Modified: 2013-02-13 11:47 EST (History)
4 users (show)

See Also:
nsand.dev: iplog+
nsand.dev: review+


Attachments
An XSD file which includes the gMonth data type (2.49 KB, application/octet-stream)
2011-05-17 13:42 EDT, Andrea Rice CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Rice CLA 2011-05-17 13:40:44 EDT
Build Identifier: M20110210-1200

There is an action to generate an XML instance document based on an XSD schema document.  If the schema contains elements of type gMonth, the value that is used to populate those fields is '--01--'.  However, according to the following schema documentation, the format should be '--01'.  

http://www.w3.org/TR/xmlschema11-2/#gMonth

There, the following is the regular expression for gMonth values:

--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?

The trailing slashes are thus invalid based on the above regular expression.

I am not positive but I think at one point there may have been an errata in the XML specification which may be why this format was used in the first place.  I believe the now erroneous format is accepted in some places but not all and it would be better to use the proper format of --01.

Reproducible: Always

Steps to Reproduce:
1.  Right-click the attached MyDateTestingTypes.xsd file
2.  Invoked the Generate > XML File... action
3.  In the New XML File Wizard, proceed to the second page and click the 'create optional elements' checkbox.
4.  Click OK to create the .xml file
Problem:  In the created file, the field 'a17_gMonth' has a value of '--01--'
Comment 1 Andrea Rice CLA 2011-05-17 13:42:09 EDT
Created attachment 195897 [details]
An XSD file which includes the gMonth data type
Comment 2 Salvador Zalapa CLA 2013-01-24 13:12:18 EST
Modifying the default value:
pushing to my mirror:

https://github.com/zalapa/webtools.sourceediting/commit/10319a7926bf6c811f6662a656182ddecbf0dd09
Comment 3 Nick Sandonato CLA 2013-02-13 11:47:06 EST
Patch looks good, Chava. Thanks!