Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RegEx not right in my XmlSchema

From: billr@-----------.---------.---
To: NULL
Date: 10/1/2007 4:07:00 AM

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>

*note, in this post the pattern above might not render exactly as described 
... the pattern uses the escape sequence & gt; 

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


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