Data Developer Center > Data Platform Development Forums > XML, System.Xml, MSXML and XmlLite > MSXML6 reports an error (MSXML4 and Xerces report no error) when validating against a DTD (ProhibitDTD=False and ResolveExternals=True)

Unanswered MSXML6 reports an error (MSXML4 and Xerces report no error) when validating against a DTD (ProhibitDTD=False and ResolveExternals=True)

  • Friday, January 15, 2010 10:58 AM
     
     
    Hi,

    I am validating an XML file against a external DTD using MSXML. When i use MSXML6 an error is reported that is not reported by MSXML4 or Xerces. I do the following:

      XMLDOMDocument.async := False;
      XMLDOMDocument.setProperty('ProhibitDTD', False);
      XMLDOMDocument.resolveExternals := True;
      XMLDOMDocument.validateOnParse := True;

    The XML:

        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE ONIXMessage SYSTEM "http://www.editeur.org/onix/2.1/03/reference/onix-international.dtd">
        <ONIXMessage>
            <Header>
                <FromCompany></FromCompany>
                <SentDate></SentDate>
            </Header>
            <Product>
                <RecordReference></RecordReference>
                <NotificationType></NotificationType>
                <ERROR></ERROR>
            </Product>
        </ONIXMessage>;

    MSXML6 reports:
    Line 9
    "Element 'RecordReference' is unexpected according to content model of parent element 'Product'." which is wrong(?)

    MSXML4 reports:
    Line 11
    "Element content is invalid according to the DTD/Schema." which is correct because "<ERROR>" is not allowed in that context.


    Can somebody help me?


    Thank you,
    - Gerben Abbink

All Replies

  • Saturday, June 12, 2010 12:24 PM
     
     
    You can check if this http://www.webreference.com/programming/javascript/rg35/2.html is useful to you.
    XML Keyword SEO Market