Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » problems at pattern facet creation/validation
problems at pattern facet creation/validation [message #72111] Wed, 25 April 2007 09:02 Go to next message
Eclipse UserFriend
Originally posted by: paradies.transit-online.de

Hi,

I've used the wtp xsd schema editor for a long time and was always happy
with it but today I've noticed strange behaviour while editing and
validating a pattern facet:

----

First of all I found relevant differences in validation of regular
expressions between Regular Expression Wizard and XSD Schema Editor.

So what's going wrong?
Suppose I want to define an range of letters using their hex values e.g.
[\x40-\x42]+. Using the Regular Expression Wizard from the properties
view this expression is fine and testable. After finishing I'm going to
validate the schema (context menu in the source editor -> validate).
Then the validator reports the following error:

"InvalidRegex: Pattern value '[\x40-\x42]+' is not a valid regular
expression. The reported error was: 'This expression is not supported in
the current option setting.'."

I know this is reported by Xerces but I've found no way neither to show
nor to control the regex options. Is this a bug or am I doing something
wrong?

----

The second issue I'd noticed appears when I've edited the expression
with the wizard again. The value of the pattern node has changed but
also a value attribute to the type node is added as shown below.

- schema source fragment before editing:

<xsd:simpleType name="XSDSimpleType">
<xsd:restriction base="xsd:string">
<xsd:pattern
value="[0x40-0x42]+"></xsd:pattern>
</xsd:restriction>
</xsd:simpleType>

- schema source fragment after editing:

<xsd:simpleType name="XSDSimpleType" value="[\x40-\x43]+">
<xsd:restriction base="xsd:string">
<xsd:pattern
value="[0x40-0x43]+"></xsd:pattern>
</xsd:restriction>
</xsd:simpleType>


Seems to be a buggy ...

----

Thomas
Re: problems at pattern facet creation/validation [message #72134 is a reply to message #72111] Wed, 25 April 2007 10:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Thomas,

Comments below.

Thomas Paradies wrote:
> Hi,
>
> I've used the wtp xsd schema editor for a long time and was always
> happy with it but today I've noticed strange behaviour while editing
> and validating a pattern facet:
Note that the WTP schema editor is provided by the WTP project not
directly by the XSD project which just provides a crude sample editor.
So I've added the webtools newsgroup to the "to" list so they will see
your question and answer it.
>
> ----
>
> First of all I found relevant differences in validation of regular
> expressions between Regular Expression Wizard and XSD Schema Editor.
>
> So what's going wrong?
> Suppose I want to define an range of letters using their hex values
> e.g. [\x40-\x42]+. Using the Regular Expression Wizard from the
> properties view this expression is fine and testable. After finishing
> I'm going to validate the schema (context menu in the source editor ->
> validate). Then the validator reports the following error:
Unfortunately I don't know anything about the regular expression
wizard. Hopefully it's not just a wizard for editing Java regular
expressions which have a different syntax than XML Schema's regular
expressions.
>
> "InvalidRegex: Pattern value '[\x40-\x42]+' is not a valid regular
> expression. The reported error was: 'This expression is not supported
> in the current option setting.'."
I can't see anything in the specification that allows for \x escaping.
>
> I know this is reported by Xerces but I've found no way neither to
> show nor to control the regex options. Is this a bug or am I doing
> something wrong?
Well, it doesn't look right to me. I think Xerces regular expression
code is general enough to support different options, but for XML Schema
purposes it has to use the XML Schema option and I don't think your
expression is right according to that.
>
> ----
>
> The second issue I'd noticed appears when I've edited the expression
> with the wizard again. The value of the pattern node has changed but
> also a value attribute to the type node is added as shown below.
>
> - schema source fragment before editing:
>
> <xsd:simpleType name="XSDSimpleType">
> <xsd:restriction base="xsd:string">
> <xsd:pattern
> value="[0x40-0x42]+"></xsd:pattern>
> </xsd:restriction>
> </xsd:simpleType>
>
> - schema source fragment after editing:
>
> <xsd:simpleType name="XSDSimpleType" value="[\x40-\x43]+">
> <xsd:restriction base="xsd:string">
> <xsd:pattern
> value="[0x40-0x43]+"></xsd:pattern>
> </xsd:restriction>
> </xsd:simpleType>
>
>
> Seems to be a buggy ...
It's certainly not correct. But I can't reproduce it with the sample
editor so I don't think it's a problem in the XSD model itself.
>
> ----
>
> Thomas
Re: problems at pattern facet creation/validation [message #72149 is a reply to message #72134] Wed, 25 April 2007 12:23 Go to previous message
Eclipse UserFriend
Originally posted by: paradies.transit-online.de

Ed,
thank you for your prompt response. See below ...
> Thomas,
>
> Comments below.
>
> Thomas Paradies wrote:
>> Hi,
>>
>> I've used the wtp xsd schema editor for a long time and was always
>> happy with it but today I've noticed strange behaviour while editing
>> and validating a pattern facet:
> Note that the WTP schema editor is provided by the WTP project not
> directly by the XSD project which just provides a crude sample editor.
> So I've added the webtools newsgroup to the "to" list so they will see
> your question and answer it.
Sorry, that was not obvious to me. Thanks for the hint.
>>
>> ----
>>
>> First of all I found relevant differences in validation of regular
>> expressions between Regular Expression Wizard and XSD Schema Editor.
>>
>> So what's going wrong?
>> Suppose I want to define an range of letters using their hex values
>> e.g. [\x40-\x42]+. Using the Regular Expression Wizard from the
>> properties view this expression is fine and testable. After finishing
>> I'm going to validate the schema (context menu in the source editor ->
>> validate). Then the validator reports the following error:
> Unfortunately I don't know anything about the regular expression
> wizard. Hopefully it's not just a wizard for editing Java regular
> expressions which have a different syntax than XML Schema's regular
> expressions.
I'm afraid yes, but we'll see ...
>>
>> "InvalidRegex: Pattern value '[\x40-\x42]+' is not a valid regular
>> expression. The reported error was: 'This expression is not supported
>> in the current option setting.'."
> I can't see anything in the specification that allows for \x escaping.
You're right it's Perl-like but I found it also for Xerces (see
http://xerces.apache.org/xerces-j/apiDocs/org/apache/xerces/ utils/regex/RegularExpression.html)
..
>>
>> I know this is reported by Xerces but I've found no way neither to
>> show nor to control the regex options. Is this a bug or am I doing
>> something wrong?
> Well, it doesn't look right to me. I think Xerces regular expression
> code is general enough to support different options, but for XML Schema
> purposes it has to use the XML Schema option and I don't think your
> expression is right according to that.
Well, then should the expression [#x40-#x43]+ do it, right? The
validation reports

"InvalidRegex: Pattern value '[#x40-#x43]+' is not a valid regular
expression. The reported error was: 'The range end code point is less
than the start code point.'"

Strange! But the expression without range [#x40#x43]+ is correct. Also
with the sample editor...
>>
>> ----
>>
>> The second issue I'd noticed appears when I've edited the expression
>> with the wizard again. The value of the pattern node has changed but
>> also a value attribute to the type node is added as shown below.
>>
>> - schema source fragment before editing:
>>
>> <xsd:simpleType name="XSDSimpleType">
>> <xsd:restriction base="xsd:string">
>> <xsd:pattern
>> value="[0x40-0x42]+"></xsd:pattern>
>> </xsd:restriction>
>> </xsd:simpleType>
>>
>> - schema source fragment after editing:
>>
>> <xsd:simpleType name="XSDSimpleType" value="[\x40-\x43]+">
>> <xsd:restriction base="xsd:string">
>> <xsd:pattern
>> value="[0x40-0x43]+"></xsd:pattern>
>> </xsd:restriction>
>> </xsd:simpleType>
>>
>>
>> Seems to be a buggy ...
> It's certainly not correct. But I can't reproduce it with the sample
> editor so I don't think it's a problem in the XSD model itself.
I agree.
>>
>> ----
>>
>> Thomas
Re: problems at pattern facet creation/validation [message #602313 is a reply to message #72111] Wed, 25 April 2007 10:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Thomas,

Comments below.

Thomas Paradies wrote:
> Hi,
>
> I've used the wtp xsd schema editor for a long time and was always
> happy with it but today I've noticed strange behaviour while editing
> and validating a pattern facet:
Note that the WTP schema editor is provided by the WTP project not
directly by the XSD project which just provides a crude sample editor.
So I've added the webtools newsgroup to the "to" list so they will see
your question and answer it.
>
> ----
>
> First of all I found relevant differences in validation of regular
> expressions between Regular Expression Wizard and XSD Schema Editor.
>
> So what's going wrong?
> Suppose I want to define an range of letters using their hex values
> e.g. [\x40-\x42]+. Using the Regular Expression Wizard from the
> properties view this expression is fine and testable. After finishing
> I'm going to validate the schema (context menu in the source editor ->
> validate). Then the validator reports the following error:
Unfortunately I don't know anything about the regular expression
wizard. Hopefully it's not just a wizard for editing Java regular
expressions which have a different syntax than XML Schema's regular
expressions.
>
> "InvalidRegex: Pattern value '[\x40-\x42]+' is not a valid regular
> expression. The reported error was: 'This expression is not supported
> in the current option setting.'."
I can't see anything in the specification that allows for \x escaping.
>
> I know this is reported by Xerces but I've found no way neither to
> show nor to control the regex options. Is this a bug or am I doing
> something wrong?
Well, it doesn't look right to me. I think Xerces regular expression
code is general enough to support different options, but for XML Schema
purposes it has to use the XML Schema option and I don't think your
expression is right according to that.
>
> ----
>
> The second issue I'd noticed appears when I've edited the expression
> with the wizard again. The value of the pattern node has changed but
> also a value attribute to the type node is added as shown below.
>
> - schema source fragment before editing:
>
> <xsd:simpleType name="XSDSimpleType">
> <xsd:restriction base="xsd:string">
> <xsd:pattern
> value="[0x40-0x42]+"></xsd:pattern>
> </xsd:restriction>
> </xsd:simpleType>
>
> - schema source fragment after editing:
>
> <xsd:simpleType name="XSDSimpleType" value="[\x40-\x43]+">
> <xsd:restriction base="xsd:string">
> <xsd:pattern
> value="[0x40-0x43]+"></xsd:pattern>
> </xsd:restriction>
> </xsd:simpleType>
>
>
> Seems to be a buggy ...
It's certainly not correct. But I can't reproduce it with the sample
editor so I don't think it's a problem in the XSD model itself.
>
> ----
>
> Thomas


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: problems at pattern facet creation/validation [message #602318 is a reply to message #72134] Wed, 25 April 2007 12:23 Go to previous message
Thomas Paradies is currently offline Thomas ParadiesFriend
Messages: 4
Registered: July 2009
Junior Member
Ed,
thank you for your prompt response. See below ...
> Thomas,
>
> Comments below.
>
> Thomas Paradies wrote:
>> Hi,
>>
>> I've used the wtp xsd schema editor for a long time and was always
>> happy with it but today I've noticed strange behaviour while editing
>> and validating a pattern facet:
> Note that the WTP schema editor is provided by the WTP project not
> directly by the XSD project which just provides a crude sample editor.
> So I've added the webtools newsgroup to the "to" list so they will see
> your question and answer it.
Sorry, that was not obvious to me. Thanks for the hint.
>>
>> ----
>>
>> First of all I found relevant differences in validation of regular
>> expressions between Regular Expression Wizard and XSD Schema Editor.
>>
>> So what's going wrong?
>> Suppose I want to define an range of letters using their hex values
>> e.g. [\x40-\x42]+. Using the Regular Expression Wizard from the
>> properties view this expression is fine and testable. After finishing
>> I'm going to validate the schema (context menu in the source editor ->
>> validate). Then the validator reports the following error:
> Unfortunately I don't know anything about the regular expression
> wizard. Hopefully it's not just a wizard for editing Java regular
> expressions which have a different syntax than XML Schema's regular
> expressions.
I'm afraid yes, but we'll see ...
>>
>> "InvalidRegex: Pattern value '[\x40-\x42]+' is not a valid regular
>> expression. The reported error was: 'This expression is not supported
>> in the current option setting.'."
> I can't see anything in the specification that allows for \x escaping.
You're right it's Perl-like but I found it also for Xerces (see
http://xerces.apache.org/xerces-j/apiDocs/org/apache/xerces/ utils/regex/RegularExpression.html)
..
>>
>> I know this is reported by Xerces but I've found no way neither to
>> show nor to control the regex options. Is this a bug or am I doing
>> something wrong?
> Well, it doesn't look right to me. I think Xerces regular expression
> code is general enough to support different options, but for XML Schema
> purposes it has to use the XML Schema option and I don't think your
> expression is right according to that.
Well, then should the expression [#x40-#x43]+ do it, right? The
validation reports

"InvalidRegex: Pattern value '[#x40-#x43]+' is not a valid regular
expression. The reported error was: 'The range end code point is less
than the start code point.'"

Strange! But the expression without range [#x40#x43]+ is correct. Also
with the sample editor...
>>
>> ----
>>
>> The second issue I'd noticed appears when I've edited the expression
>> with the wizard again. The value of the pattern node has changed but
>> also a value attribute to the type node is added as shown below.
>>
>> - schema source fragment before editing:
>>
>> <xsd:simpleType name="XSDSimpleType">
>> <xsd:restriction base="xsd:string">
>> <xsd:pattern
>> value="[0x40-0x42]+"></xsd:pattern>
>> </xsd:restriction>
>> </xsd:simpleType>
>>
>> - schema source fragment after editing:
>>
>> <xsd:simpleType name="XSDSimpleType" value="[\x40-\x43]+">
>> <xsd:restriction base="xsd:string">
>> <xsd:pattern
>> value="[0x40-0x43]+"></xsd:pattern>
>> </xsd:restriction>
>> </xsd:simpleType>
>>
>>
>> Seems to be a buggy ...
> It's certainly not correct. But I can't reproduce it with the sample
> editor so I don't think it's a problem in the XSD model itself.
I agree.
>>
>> ----
>>
>> Thomas
Previous Topic:problems at pattern facet creation/validation
Next Topic:Schema Merging
Goto Forum:
  


Current Time: Tue Apr 23 06:34:29 GMT 2024

Powered by FUDForum. Page generated in 0.03432 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top