Problem Validating xhtml against schema
Having trouble installing Oxygen? Got a bug to report? Post it all here.
Problem Validating xhtml against schema
Post by Guest »
Validating the following document in Oxygen, shows what appear to be errors caused by parsing the processing instruction on line 1, and w3c xml... attribute values on lines 3 and 5, according to the XML schema instance specified in line 5. The errors diagnose '-' characters as invalid syntax.
1. On line 5, URL http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd is correctly de-referenced by a browser to the schema code.
2. However, oxygen flags three errors, similar to the following, for the above document.
3. Escaping the - in line 1 makes it impossible to store and validate the document.
4. Escaping the - in lines 3 or 5, prevents location of the schema, which prevents diagnosis of the '-' chars as bad syntax, but also prevents validation of the document with error
Questions
---------
a. Is there a workaround for validating xhtml ?
b. I have been composing the above 'form' presentation of errors manually in a text editor, by copy and paste from the Problems tab. Is there an automatic way of doing this in Oxygen?
Bill.
If I am totally off the wall here, I apologize in advance.
Code: Select all
01 <?xml version="1.0" encoding="UTF-8"?>
02 <xhtml:html
03 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
04 xsi:schemaLocation="http://www.w3.org/1999/xhtml
05 http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd"
06 xmlns:xhtml="http://www.w3.org/1999/xhtml"
07 >
08 <xhtml:head><xhtml:title>Some title</xhtml:title></xhtml:head>
09 <xhtml:body>
10 <xhtml:p>Some text</xhtml:p>
11 </xhtml:body>
12 </xhtml:html>
2. However, oxygen flags three errors, similar to the following, for the above document.
Code: Select all
Severity 2
Description InvalidRegex: Pattern value '[-+]?(\d+|\d+(\.\d+)?%)'
is not a valid regular expression. The reported error
was: ''-' is an invalid character range. Write '\-'.'.
SystemID: http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd Line: 230
Resource xhtml-using-xforms.xml
In Folder vendorSite/webRoot/WEB-INF/resources/pagesets/checkout
Location line 1
Creation Time September 24, 2004 5:35:56 PM
4. Escaping the - in lines 3 or 5, prevents location of the schema, which prevents diagnosis of the '-' chars as bad syntax, but also prevents validation of the document with error
Code: Select all
Severity 2
Description cvc-elt.1: Cannot find the declaration of element 'xhtml:html'.
Resource xhtml-using-xforms.xml
In Folder vendorSite/webRoot/WEB-INF/resources/pagesets/checkout
Location line 8
Creation Time September 25, 2004 8:21:29 AM
---------
a. Is there a workaround for validating xhtml ?
b. I have been composing the above 'form' presentation of errors manually in a text editor, by copy and paste from the Problems tab. Is there an automatic way of doing this in Oxygen?
Bill.
If I am totally off the wall here, I apologize in advance.
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Bill,
The schema http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd is not valid. There are 4 places where - is used in pattern value without being escaped. You should corrent that and save the schema locally. Create then an XML catalog to resolve the http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd system ID to your corrected schema file and set it in oXygen. After that you should be able to validate your documents against the corrected schema although you specify the http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd in your schema document. For more details about the escaping of - in pattern values see the related topic:
http://www.oxygenxml.com/forum/ftopic581.html
You a string representation of the error in the Eclipse plugin if you use the Copy contextual menu action on the corresponding problem marker in the the Problems View. In the standalone version there is a Show message action also on the contextual menu of the, in this case, Errors view.
Best Regards,
George
The schema http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd is not valid. There are 4 places where - is used in pattern value without being escaped. You should corrent that and save the schema locally. Create then an XML catalog to resolve the http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd system ID to your corrected schema file and set it in oXygen. After that you should be able to validate your documents against the corrected schema although you specify the http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd in your schema document. For more details about the escaping of - in pattern values see the related topic:
http://www.oxygenxml.com/forum/ftopic581.html
You a string representation of the error in the Eclipse plugin if you use the Copy contextual menu action on the corresponding problem marker in the the Problems View. In the standalone version there is a Show message action also on the contextual menu of the, in this case, Errors view.
Best Regards,
George
-
- Posts: 37
- Joined: Tue Nov 25, 2003 3:31 am
George,
I downloaded http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd,
to make a local copy in which to fix the pattern error. However, could not find the
pattern mentioned in your previous note to Yaakov Chalkin.
I also searched http://www.w3.org/2001/xml.xsd, which is imported
by http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd
Obviously, I'm not looking at the right thing. In which document should I be making
the correction.
I downloaded http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd,
to make a local copy in which to fix the pattern error. However, could not find the
pattern mentioned in your previous note to Yaakov Chalkin.
Code: Select all
[\sa-zA-Z0-9-]* -- to be changed to -- [\sa-zA-Z0-9\-]*
by http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd
Obviously, I'm not looking at the right thing. In which document should I be making
the correction.
Bill W.
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Bill,
Sorry, I should have been more explicit. I ment the problem was similar with the problem from that topic, a - was used in a pattern unescaped.
You should change
line 231 <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)"/>
to
<xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)"/>
line 242 <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
to
<xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
and
line 278 value="[-+]?(\d+|\d+(\.\d+)?%)(,\s*[-+]?(\d+|\d+(\.\d+)?%))*"/>
to
value="[\-+]?(\d+|\d+(\.\d+)?%)(,\s*[\-+]?(\d+|\d+(\.\d+)?%))*"/>
Best Regards,
George
Sorry, I should have been more explicit. I ment the problem was similar with the problem from that topic, a - was used in a pattern unescaped.
You should change
line 231 <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)"/>
to
<xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)"/>
line 242 <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
to
<xs:pattern value="[\-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
and
line 278 value="[-+]?(\d+|\d+(\.\d+)?%)(,\s*[-+]?(\d+|\d+(\.\d+)?%))*"/>
to
value="[\-+]?(\d+|\d+(\.\d+)?%)(,\s*[\-+]?(\d+|\d+(\.\d+)?%))*"/>
Best Regards,
George
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