XML Schema with String pattern gives error only in author mo
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 3
- Joined: Fri Mar 06, 2009 2:08 am
XML Schema with String pattern gives error only in author mo
Here is a simple example which produces an error in author mode, bud is valid in text mode:
Stylesheet.css:
Schema.xml:
(xml.xsd in same directory)
Test XML Document:
When looking at the Text XML document in text-mode, everything is ok. But when switching to author mode, there is an error: "... not facet-valid with respect to pattern ...". The error goes away if reducing the length of the text (cutting one 'This is a test. " away). This problem is present since I am using OxygenXML (2 Years?)
Thanks in advance for checking that.
Max Renkin
Stylesheet.css:
Code: Select all
@charset "UTF-8";
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xs:element name="SCRIBBLE">
<xs:complexType>
<xs:sequence>
<xs:element name="PROBLEM_DEMO">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value=".*\S\S\S.*"/>
<!--xs:whiteSpace value="collapse"></xs:whiteSpace-->
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Test XML Document:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="Stylesheet.css" type="text/css"?>
<SCRIBBLE xsi:noNamespaceSchemaLocation="Schema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PROBLEM_DEMO>This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a</PROBLEM_DEMO>
</SCRIBBLE>
Thanks in advance for checking that.
Max Renkin
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: XML Schema with String pattern gives error only in author mo
Dear Max,
The problem is that the document is serialized from the Author in order to be validated and the formatting that is applied destroys the text from the PROBLEM_DEMO element. You can see that if you make an irrelevant change in the author and then move to Text mode - you will be even able to reproduce the same error message.
The solution is to enable the "Preserve space as it is" option from Options->Preferences -- Editor / Format / XML.
Best Regards,
George
The problem is that the document is serialized from the Author in order to be validated and the formatting that is applied destroys the text from the PROBLEM_DEMO element. You can see that if you make an irrelevant change in the author and then move to Text mode - you will be even able to reproduce the same error message.
The solution is to enable the "Preserve space as it is" option from Options->Preferences -- Editor / Format / XML.
Best Regards,
George
George Cristian Bina
-
- Posts: 9439
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XML Schema with String pattern gives error only in author mo
Hi,
Another solution is to specify the PROBLEM_DEMO as space preserve in the Stylesheet.css:
Regards,
Radu
Another solution is to specify the PROBLEM_DEMO as space preserve in the Stylesheet.css:
Code: Select all
PROBLEM_DEMO{
white-space:pre-wrap;
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
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