Generate example instances - enforce regex patterns

This should cover W3C XML Schema, Relax NG and DTD related problems.
Posts: 42

Generate example instances - enforce regex patterns

Wed Mar 08, 2017 11:52 am

Dear Oxygen colleagues,

I noticed that when generating examples with XSDs containing following content model, not all of the restrictions are followed:

Code: Select all

    <xs:simpleType name="datetime-profile">
        <xs:restriction base="xs:dateTime">

The bold part enforces that the ISO 8601 timezone MUST be present.

This works in oxygen for validation of existing instances; however, new instances generated using this type do not have timezone info.

When it's added manually the instances validate.
Posts: 2443

Re: Generate example instances - enforce regex patterns

Fri Mar 10, 2017 7:22 pm


I'm afraid this is not working due to the fact that xs:dateTime already has a pattern. The XML instance generator from Oxygen cannot combine two patterns when generating sample values, so any restriction that you add to such types cannot be enforced.

Please see the discussion here: date format in xmlGenerator

Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 2 guests