IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

xs:date validation bug in xmlspy 2015 rel.4? Options · View
vlax
Posted: Tuesday, July 21, 2015 11:16:00 AM
Rank: Member

Joined: 7/8/2013
Posts: 10
Location: SW
Hi
On our dev environment we were using XmlSpy 2011-2012 now a new coworker installed an evaluation version of XmlSpy 2015 rel.4 and we are getting some strange validation error with a custom date data type.

Here the data type schema definition:

Code:

    <xs:simpleType name="keineAngabe">
        <xs:annotation>
            <xs:documentation/>
        </xs:annotation>
        <xs:restriction base="xs:token">
            <xs:enumeration value="keine Angabe"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="datumTypA">
        <xs:annotation>
            <xs:documentation>Zeitpunkte: the following values are possible by date type 1 regular expression
                historische Anwendung
                31.01.2004
                ca.31.01.2004
                2004
                ca.2004
                keine Angabe
            </xs:documentation>
        </xs:annotation>
        <xs:union memberTypes="xs:date xs:gYear keineAngabe"/>
    </xs:simpleType>

    <xs:complexType name="historischerZeitpunkt">
        <xs:sequence>
            <xs:element name="ca" type="ca" default="false" minOccurs="0"/>
            <xs:element name="datum" type="datumTypA"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="historischerZeitraum">
        <xs:sequence>
            <xs:element name="von" type="historischerZeitpunkt"/>
            <xs:element name="bis" type="historischerZeitpunkt"/>
        </xs:sequence>
    </xs:complexType>



and XML


Code:


    <entstehungszeitraum>
      <von>
        <datum>2011-08-19</datum>
      </von>
      <bis>
        <datum>2013-08-29</datum>
      </bis>
    </entstehungszeitraum>




When running a validation in XmlSpy 2011-12 that xml pass the validation with no problems, in XmlSpy 2015 is another story
We are getting the following:



Is this a bug or I'm missing some new configuration or the like? I searched the XmlSpy 2015 user manual for something related to this but the only chunk of information I found was:

Quote:

8.3.4 Working with Dates

Note on date formats
In the XML document, dates can be stored in one of several date datatypes. Each of these
datatypes requires that the date be stored in a particular lexical format in order for the XML
document to be valid. For example, the xs:date datatype requires a lexical format of YYYY-MMDD.
If the date in an xs:date node is entered in anything other than this format, then the XML
document will be invalid.
In order to ensure that the date is entered in the correct format, the SPS designer can include the
graphical Date Picker in the design. This would ensure that the date selected in the Date Picker
is entered in the correct lexical format. If there is no Date Picker, the Authentic View should take
care to enter the date in the correct lexical format. Validating the XML document could provide
useful tips about the required lexical format.



which seems to confirm that this is a bug.

Thanks in advance for your support
Vlax

vlax
Posted: Tuesday, July 21, 2015 11:27:05 AM
Rank: Member

Joined: 7/8/2013
Posts: 10
Location: SW
Actually the problem is here: <xs:union memberTypes="xs:date xs:gYear keineAngabe"/>
if I delete the keineAngabe token it validates correctly again, but why was this working in previous version and now it suddenly stopped?
island
Posted: Wednesday, July 22, 2015 5:08:33 AM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
Hi,

as you didn't provide the complete xml or xsd file I created two example files based upon your example and the validation worked for me in both 2015r4 and 2015r4sp1. See attached files.

If you are still having problems validating your xml file I would suggest attaching your complete files.

File Attachment(s):
test.zip (1kb) downloaded 320 time(s).


Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.