Generate example instances - enforce regex patterns
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 43
- Joined: Tue Jul 26, 2016 6:31 pm
Generate example instances - enforce regex patterns
Dear Oxygen colleagues,
I noticed that when generating examples with XSDs containing following content model, not all of the restrictions are followed:
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.
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">
<xs:pattern
value="([^\.]*|([^\.]*(\.((\d){1,3})){0,1}))[b](Z|\+([01][0-9]|2[0-3]):([0-5][0-9])|-([01][0-9]|2[0-3]):([0-5][0-9])[/b])"
/>
</xs:restriction>
</xs:simpleType>
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: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Generate example instances - enforce regex patterns
Hello,
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
Regards,
Adrian
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
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service