Incorrect pattern matching
Having trouble installing Oxygen? Got a bug to report? Post it all here.
Incorrect pattern matching
Post by Pierre »
Hi,
One of my pattern matching validation attribute failed without understandeable reason:
The following schema is used :
The following instance extract is refused :
My environment seems to be correct :
Windows 2000 workstation
Best,
One of my pattern matching validation attribute failed without understandeable reason:
The following schema is used :
Code: Select all
....
<xd:simpleType name="t_no.oj">
<xd:restriction base="xd:string">
<xd:pattern value="\d{1,3}(A|E){0,1}"/>
</xd:restriction>
</xd:simpleType>
....
<xd:element ref="NO.OJ" minOccurs="0"/>
....
<xd:element name="NO.OJ" type="t_no.oj"/>
....
Code: Select all
<NO.OJ>876</NO.OJ>
Windows 2000 workstation
Code: Select all
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
Dear Pierre,
The schema snippet you posted cannot be validated so I changed it as follows:
If you name this as sample.xsd and in the same directory create an XML file with the following content:
the validation check will report no errors.
If you still have problems please post the exact sample files you are using.
Best Regards,
George
The schema snippet you posted cannot be validated so I changed it as follows:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="t_no.oj">
<xs:restriction base="xs:string">
<xs:pattern value="\d{1,3}(A|E){0,1}"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="NO.OJ" type="t_no.oj"/>
</xs:schema>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<NO.OJ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sample.xsd">876</NO.OJ>
If you still have problems please post the exact sample files you are using.
Best Regards,
George
Dear George,
Thank you for your endevour. I finally found the problem origin.
The pattern matching is correct but the apparence is well described in the previous post. The reason is simple. UTF-8 Hidden characters exist between <NO.OJ> and 876. With the oxygen editor, I didn't see them. The illegal characters were in hexadecimal EF BB BF.
Is it anyway to view special or hidden characters ?
Best regards,
Pierre
Thank you for your endevour. I finally found the problem origin.
The pattern matching is correct but the apparence is well described in the previous post. The reason is simple. UTF-8 Hidden characters exist between <NO.OJ> and 876. With the oxygen editor, I didn't see them. The illegal characters were in hexadecimal EF BB BF.
Is it anyway to view special or hidden characters ?
Best regards,
Pierre
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