Altova Mailing List Archives

Re: MSXML 4 Not seeing missing elements when validating....

From: "Joe Fawcett" <joefawcett@----------.------>
Date: 9/28/2005 9:58:00 AM
"WHoit" <WHoit@d...> wrote in message 
>I don't think I follow you - MY XML files have this beginning:
> <?xml version="1.0" encoding="UTF-8"?>
> <myParameters xmlns:xsi=""
> xsi:noNamespaceSchemaLocation="Schemas/myParametersSchema.xsd">
> My VB Code accesses XML file this way:
> Dim xmlparams As New DOMDocument40
> xmlparams.async = False
> xmlparams.validateOnParse = True
> xmlparams.resolveExternals = True
> xmlparams.Load currentparamsfile
> If xmlparams.parseError <> 0 Then
>    reason = xmlparams.parseError.reason & " at line " &
> xmlparams.parseError.Line & ", position " & xmlparams.parseError.linepos
>    msgbox "****ERROR - Parameters xml file is most likely malformed:" &
> vbCrLf & reason
> End If
> Now, if an element within my XML file is incorrect (as I mentioned in my
> original post), I get a parsing error.
> However, if an element is missing - no error. (This is the problem I need to
> solve)
> So why do you think it's not validating?
> "Joe Fawcett" wrote:
I don't in that case.
You originally said you were "using a namespace declaration which indicates the 
You are not, using a namespace declaration is totally separate from declaring a 
Usinga namespace is like:
<xsl:stylesheet xmlns:myNs= ....

or in your particular case


You are correctly declaring a schema using:


Although you need to have the first, which declares the namespace prefix mapping 
so that the xsi prefix is recognised in the second statement the two are 
separate things.

Have you tried validating using the SchemaCache instead of relying on the parser 
to find the file?


Joe (MVP - XML) 


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.