Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: RegEx not right in my XmlSchema

From: usenet@--------------.---
To: NULL
Date: 10/2/2007 2:05:00 AM

On 1 Oct, 14:01, billr <bi...@discussions.microsoft.com> wrote:
>
> The solution appears to be ... defining the content element as follows:
>
> <xs:simpleType name="CDATAContentElementType">
>     <xs:restriction base="xs:string">
>       <xs:pattern value="\s*(\d*|\w*|\W*|\s*|.*|>*)*\s*" />
>     </xs:restriction>
> </xs:simpleType>

Looking at your pattern, by including \w*|\W* (i.e. anything that is a
word character or anything that isn't a word character), then I think
your pattern will match anything, so it's probably not providing you
any validation beyond xs:string.

My test of the pattern seemed to say the pattern was correct.  If
trying to match <![CDATA[... is giving you grief, how about trying to
match something like .![CDATA[... and then checking that the first
character is a < later?  (A bit of a hack, but might ease your
suffering:-)

HTH,

Pete.

P.S. As you mentioned, there are small differences between the likes
of Perl regular expressions and xml schema regular expressions, but
they don't come into play with the pattern you have.  You have escaped
things like < and ! more than necessary, but this shouldn't be a
problem.
--
=============================================
Pete Cordell
Codalogic
for XML Schema to C++ data binding visit
 http://www.codalogic.com/lmx/
=============================================



transparent
Print
Mail
Like It
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