Version 0.9  What is XML4Ada95?  Installation  How-To  API  Download 

COUNTER
counter


How to validate an XML-document

Validating an XML-Document can't become much easier than with XML4Ada95. After you created your Parser (as shown in the previous How-To) you just have to switch the features on.

Here we go:

  ...
  Reader := ImplementationLS.CreateDOMParser(ImplementationLS.Fetch);

  Parser.SetFeature(Reader, From_Standard_String("validate-if-schema"), True);
  Parser.SetFeature(Reader, From_Standard_String("validation"), True);
  Parser.SetFeature(Reader, From_Standard_String("datatype-normalization"), True);

  Parser.Set_ErrorHandler(Reader, MyErrorHandler'Access);

  Doc := Parser.ParseURI(Reader, From_Standard_String("test1.xml"));
  ...

That's it. And if you need any more help, take a peek at the examples, one of those is doing nothing else but validating.


... parse a document ... validate a document ... get informations

e-Mail: denny@nodix.de

design shareright © 2002 Phlash  
inhalt © 2003-04 Zdenko Denny Vrandecic  
last update: 14.01.2004 website created by XML4Ada95 DocGen