Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 124079 - XSD Validator complains of invalid regex
Summary: XSD Validator complains of invalid regex
Status: CLOSED INVALID
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xsd (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: wst.xsd CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-17 02:20 EST by Steve Fernandez CLA
Modified: 2006-09-25 03:02 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Fernandez CLA 2006-01-17 02:20:20 EST
The regex in the below xsd snippet is termed as invalid by the XSD Validator. IMHO, it is valid.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/NewXMLSchema" xmlns:tns="http://www.example.org/NewXMLSchema">
	<xsd:simpleType name="LoginNameType">
		<xsd:annotation>
			<xsd:documentation>Name that uniquely identifies a user of the system.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="6"/>
			<xsd:maxLength value="30"/>
			<xsd:pattern value="[a-zA-Z0-9 \.\,#\-\\\:\;\@]+"/>
		</xsd:restriction>
	</xsd:simpleType>
</xsd:schema>

Thanks,
-Steve
Comment 1 Gary Horen CLA 2006-02-23 20:12:08 EST
Possible to fix for 1.0.2?
Comment 2 Craig Salter CLA 2006-02-24 18:06:16 EST
According to our resident Xerces expert (Michael Glavassevich) this is not a bug although he agreess the error message is rather misleading.  I'm going to return this bug (as invalid) since it sounds like a valid error. Feel free to comment if you disagree and we can evaluate this further.

Here's Michael's comments...

[a-zA-Z0-9 \.\,#\-\\\:\;\@]+ looks invalid to me.  The value of a pattern [1] must conform to the syntax for regular expressions [2] defined in the schema spec. Under production 24 [Single Character Escape], there is a table listing all of the valid single character escapes. Several of the escapes being used in this expression are not in the table.  

The error message: "This expression is not supported in the current option setting" is misleading.  The option its referring to instructs the regular expression parser to parse the pattern according to the rules of XML schema.  You cannot configure it.

Thanks.

[1] http://www.w3.org/TR/xmlschema-2/#dt-pattern
[2] http://www.w3.org/TR/xmlschema-2/#regexs
Comment 3 David Williams CLA 2006-09-25 03:02:49 EDT
This bug was moved to 'closed' state, since it is so old is is assumed its dup, invalid, or worksforme resolution is no longer in qustion and the bugzilla needs no further attention. Feel free to re-open, or open a new bug, if this semi-automatic processing was done in error in this case.