Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Mon, 1 Oct 2007 03:59:01 -0700,    group: microsoft.public.dotnet.distributed_apps        back       


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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us