XML Validation Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • June Brown

    #1

    XML Validation Problem

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

    XML := CreateOLEObject ('MSXML2.DOMDoc ument.4.0');
    Xml.validateOnP arse := true;
    XML.resolveExte rnals := true;
    XSDL := CreateOLEObject ('MSXML2.XMLSch emaCache.4.0');
    xsdl.validateOn Load := 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.x ML');

    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!.
  • Martin Honnen

    #2
    Re: XML Validation Problem



    June Brown wrote:
    [color=blue]
    > I am trying to validate some xml via msxml (works OK via xmlspy).
    >
    > XML := CreateOLEObject ('MSXML2.DOMDoc ument.4.0');
    > Xml.validateOnP arse := true;
    > XML.resolveExte rnals := true;
    > XSDL := CreateOLEObject ('MSXML2.XMLSch emaCache.4.0');
    > xsdl.validateOn Load := true;
    > XSDL.add(NSEdit .Text,'aaa.xsd' );
    > XSDL.add(NSEdit .Text,'bbb.xsd' );
    > XSDL.add(NSEdit .Text,'ccc.xsd'[/color]

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




    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • June Brown

      #3
      Re: XML Validation Problem


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

      I could just do

      xml.load('aaa.x sd')

      but this fails too.


      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Martin Honnen

        #4
        Re: XML Validation Problem



        June Brown wrote:
        [color=blue]
        > All the xsd have the same target namespace, so in reality
        >
        > I could just do
        >
        > xml.load('aaa.x sd')
        >
        > but this fails too.[/color]

        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.publi c.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.

        --

        Martin Honnen
        http://JavaScript.FAQTs.com/

        Comment

        Working...