RegEx not right in my XmlSchema
I apologise if this has gone to the wrong disvussion group, however, I'm
really not sure to which group it actually should be posted. So, here's my
plight ...
The following is my RegEx expression
\<\!\[CDATA\[\s*(\d*|\w*|\W*|\s*|.*|>*)*\s*\]\]\>
The following is my dataset
<![CDATA[<P ALIGN=\"LEFT\"><FONT FACE=\"Yell Corpid
Regular\" SIZE=\"25\" COLOR=\"#FF0000\" LETTERSPACING=\"0\"
KERNING=\"0\">title text here...</FONT></P>]]>
So far, so good, all's well that ends well and all. Except, when I use the
RegEx as a pattern in my XSD, for example ...
<xs:simpleType name="CDATAContentElementType">
<xs:restriction base="TextType">
<xs:pattern value="\<\!\[CDATA\[\s*(\d*|\w*|\W*|\s*|.*|>*)*\s*\]\]\>" />
</xs:restriction>
</xs:simpleType>
Having this defined I write some XML (you might notice the CDATA is exactly
the same as above)
<content><![CDATA[<P ALIGN=\"LEFT\"><FONT FACE=\"Yell Corpid Regular\"
SIZE=\"25\" COLOR=\"#FF0000\" LETTERSPACING=\"0\" KERNING=\"0\">title text
here...</FONT></P>]]></content>
However, within VisualStudio IDE it is reported that ...
The 'xxx.xsd:content' element is invalid - The value '<cdata contents go
here>' is invalid according to its datatype 'xxx.xsd:CDATAContentElementType'
- The Pattern constraint failed.
So, I think that maybe there is a problem with my RegEx, but I can find no
information as to what is wrong with it. Clearly there is a difference
between RegEx and RegEx for Xml, but I don't know what ti is :o(
Please, please help a man almost reduced to tears ;o)
--
Of all words of tongue and pen, the saddest are: "It might have been"
Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
date: Mon, 1 Oct 2007 03:59:01 -0700
author: billr