XML Validation Problem

J

June Brown

I am trying to validate some xml via msxml (works OK via xmlspy).

XML := CreateOLEObject('MSXML2.DOMDocument.4.0');
Xml.validateOnParse := true;
XML.resolveExternals := true;
XSDL := CreateOLEObject('MSXML2.XMLSchemaCache.4.0');
xsdl.validateOnLoad := true;
XSDL.add(NSEdit.Text,'aaa.xsd');
XSDL.add(NSEdit.Text,'bbb.xsd');
XSDL.add(NSEdit.Text,'ccc.xsd'
XML.async := false;
XML.load('aaa.xML');

bbb.xsd references a simple type in ccc.xsd, but msxml doesn't find
it, as I said xmlspy does.
Also mslxml doesn't seem to pick up the maxlength attribute.

Can any one give me some pointers to what I am doing wrong, or tell be
of a 3rd party product I can use from within code, which works!.
 
M

Martin Honnen

June said:
I am trying to validate some xml via msxml (works OK via xmlspy).

XML := CreateOLEObject('MSXML2.DOMDocument.4.0');
Xml.validateOnParse := true;
XML.resolveExternals := true;
XSDL := CreateOLEObject('MSXML2.XMLSchemaCache.4.0');
xsdl.validateOnLoad := true;
XSDL.add(NSEdit.Text,'aaa.xsd');
XSDL.add(NSEdit.Text,'bbb.xsd');
XSDL.add(NSEdit.Text,'ccc.xsd'

Are all those schema files for the same namespace? Otherwise you would
need to pass a different namespace as the first argument to add.
 
J

June Brown

All the xsd have the same target namespace, so in reality

I could just do

xml.load('aaa.xsd')

but this fails too.
 
M

Martin Honnen

June said:
All the xsd have the same target namespace, so in reality

I could just do

xml.load('aaa.xsd')

but this fails too.

It is hard to tell what goes wrong, if you can't solve it yourself then
consider putting up the XML instance file and the XML schema files on a
public HTTP server and posting the URLs in a newsgroup. As you are using
MSXML and want help on that I think the group microsoft.public.xml is a
better place to ask as more MSXML users read and post there than in this
general XML group. Also try to reduce the files as far as possible to
demonstrate the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top