Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Schema pattern's and dashes.

From: "Anthony Jones" <Ant@------------.--->
To: NULL
Date: 11/4/2006 7:51:00 PM


<requeth@g...> wrote in message
news:1162579227.261072.66150@f......
> Hello,
>
> I'm using a schema with pattern validation for field edits. Everything
> is working well except when it attempts to validate dashes. I'm using
> &#45; as the code for the dash -, but it keeps rejecting the character
> in field. Here is an example of my pattern that I am running:
>
> <xs:pattern value="[0-9, a-z, A-Z, &amp;,&#39;, &#44;, &#45;, &#40;,
> &#41;, &#46;, &#35; &#34;, &#32;]{1,60}"></xs:pattern>
>
> Everything else works 100% by design except the dash. Any ideas?
>
> Thanks,
>
> T Starid
>

Try this:-

<xs:pattern value="[0-9a-zA-Z, &amp;\-().#&#34;]{1,60}">

There is no need to separate elements in character group with comma space.
All that was doing was including comma and space in the list of characters
to match.  There is also no need to use XML escape for most of the
characters.

The problem with dash - is it is one of the few characters that has a
meaning in the inside a character group so needs to be escaped with \ even
if the dash is encoded using the XML escape since all xml escapes will be
transformed to the appropriate character before the expression is parsed.





transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent