Solved

MSXML/W3C pattern value problem

Posted on 2001-07-03
7
229 Views
Last Modified: 2008-03-10
I am using MSXML Parser v4.0 which supports W3C XSD schemas.

When I validate XML against a schema is correctly validates the minLength and maxLength values, however, it appears to completely ignore the pattern value.

I have tried numerous patterns like "\d{32}", "[0-9]{32}" etc. but they do not work.

Any ideas?



0
Comment
Question by:DavidDunn
7 Comments
 
LVL 6

Expert Comment

by:wbradney
ID: 6250034
DavidDunn,

Please post your schema and an example XML document.

Regards,
WMB
0
 

Expert Comment

by:ashish2k
ID: 6251893
Hi David Dunn
Please specify the full code in the comments and then I will look at it and then I will be able to tell you what can be the problem?
Regards,
Ashish
0
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 6252655
David,

Yes, it's true. See "what's new" section in the SDK documentation:

> The MSXML 4.0 Technology Preview does not support regular expressions and identity constraints.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:DavidDunn
ID: 6252865
XML
=================================================
<?xml version="1.0" encoding="UTF-8"?>
<test:Sample xmlns:test="urn:Func">
     <ID>ZZDDDDDDDDDXDDDDDDDDDDDDWDDDDDDD</ID>
</test:Sample>
=================================================

XSD
=================================================
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <xsd:simpleType name="typID">
          <xsd:restriction base="xsd:string">
               <xsd:minLength value="32"/>
               <xsd:pattern value="[0-9]{32}"/>
          </xsd:restriction>
     </xsd:simpleType>

     <xsd:complexType name="typSample">
          <xsd:sequence>
               <xsd:element name="ID" type="typID"/>
          </xsd:sequence>
     </xsd:complexType>

     <xsd:element name="Sample" type="typSample"/>
</xsd:schema>
=================================================

VB Code
=================================================
Private mobjDOM As New DOMDocument40
Private mobjSchema As New XMLSchemaCache40

Private Sub Command1_Click()

    mobjSchema.Add "urn:Func", "c:\test\func.xsd"
    mobjDOM.async = False
   
    Set mobjDOM.schemas = mobjSchema

    mobjDOM.Load "c:\test\id.xml"
   
    If mobjDOM.parseError.errorCode <> 0 Then
   
        MsgBox mobjDOM.parseError.reason
    Else
   
        MsgBox "OK"
   
    End If

End Sub
=================================================
0
 

Author Comment

by:DavidDunn
ID: 6252882
Yury_Delendik,

Not the answer I wanted to hear, but I thought it might be the case.

As this is only a preview version, do you know if the release version of MSXML 4 will contain this functionality?
0
 

Author Comment

by:DavidDunn
ID: 6253168
Also,

Is there another parser which I can use that will perform this validation?

Thanks.
0
 
LVL 10

Accepted Solution

by:
Yury_Delendik earned 300 total points
ID: 6253541
I know it's bad, but it's true.

Try to use any Java parser, e.g. Xerces. If you like Windows and COM technology you may use VJ++ for COM DLL creating ...
... and you can partially implement DOMDocument interface.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
XML template problem 4 58
Vb.net XML Read all nodes and 4 63
XML Parsing Classic ASP 5 43
Trouble parsing soap xml result 3 29
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now