OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Schema / XML document parsing

[ Lists Home | Date Index | Thread Index ]
  • To: "Phil Fuhlman" <pfuhlman@Dexma.com>,"xml-dev" <xml-dev@lists.xml.org>
  • Subject: RE: [xml-dev] Schema / XML document parsing
  • From: "Dare Obasanjo" <dareo@microsoft.com>
  • Date: Fri, 19 Apr 2002 10:41:10 -0700
  • Thread-index: AcHnpRbuxeajnpbWSUCdL6t923LyIwAFdhnQAAOUwUA=
  • Thread-topic: [xml-dev] Schema / XML document parsing

MSXML currently does not support the ability to recover after a
validation error has occurred. This functionality is currently being
considered for a future version. 

-- 
PITHY WORDS OF WISDOM 
The best time to buy something was last year. 
 
This posting is provided "AS IS" with no warranties, and confers no
rights. 
You assume all risk for your use. (c) 2002 Microsoft Corporation. All
rights reserved.



> -----Original Message-----
> From: Phil Fuhlman [mailto:pfuhlman@Dexma.com] 
> Sent: Friday, April 19, 2002 8:50 AM
> To: xml-dev
> Subject: RE: [xml-dev] Schema / XML document parsing
> 
> 
> The following VBScript exercises this feature in MSXML4. The 
> major problem I have with MSXML4 is that it quits on the 
> first error, versus trying to recover and continue, hopefully 
> catching any and all problems in one pass. (So if any one 
> knows how to change this behavior and will share it I'd be 
> much obliged :) ).
> 
> Set schemaCache = CreateObject("MSXML2.XMLSchemaCache.4.0")
> 
> ' load schema - it reports its own terse syntax errors
> 
> schemaCache.Add "", "C:\schema\model1.xsd"
> 
> Set doc = CreateObject("MSXML2.DOMDocument.4.0")
> Set doc.schemas = schemaCache		' associate schema w/ data (xml
> doc)
> 
> 'Now you are ready to load the XML document and do the validation:
> 
> doc.async = False
> 
> If Not doc.Load("C:\data\model1.xml") Then
> 
>         wscript.echo "Error loading XML document: " & 
> doc.parseError.reason & " errcode: " & doc.parseError.errorCode & "
> line: " & doc.parseError.line & " filepos: " & 
> doc.parseError.filepos & " linepos: " & 
> doc.parseError.linepos & " srctext: " & doc.parseError.srcText
> 
> else
> 
>         wscript.echo "no errors"
> 
> End If
> 
> 
> -----Original Message-----
> From: Dean James Greenwood [mailto:D.Greenwood@cs.ucl.ac.uk]
> Sent: Friday, April 19, 2002 8:30 AM
> To: xml-dev
> Subject: [xml-dev] Schema / XML document parsing
> 
> 
> Hello,
> 
> Does anyone know of a class/tool which accepts a XML Document 
> and the corresponding Schema for that document and validates 
> the document against the schema (instance against the type)?
> 
> -- 
> Kind regards,
>        Dean
> 
> Dean James Greenwood BSc
> DCNDS MSc 
> University College London                          
> mailto:dean@deangreenwood.com
> http://www.deangreenwood.com
> 
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org 
> <http://www.xml.org>, an initiative of OASIS 
<http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>


-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS