dk.brics.xact.operations
Class XMLValidator

java.lang.Object
  extended by dk.brics.xact.operations.XMLValidator

public class XMLValidator
extends Object

Schema validation for XML templates. Supported schema languages: DTD, XML Schema, and Restricted RELAX NG.


Method Summary
static String expandQName(String type, Map<String,String> map1, Map<String,String> map2, Origin origin)
          Converts a QName into an expanded name using the given namespace maps.
static void loadXMLSchema(URL url)
          Loads an XML schema.
static Map<String,SequenceNode> loadXMLSchema(URL url, XMLGraph xg)
          Loads an XML schema into an existing XML graph.
static void validate(XML x, String type, Origin origin)
          Checks that the given template is valid according to the given schema type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

expandQName

public static String expandQName(String type,
                                 Map<String,String> map1,
                                 Map<String,String> map2,
                                 Origin origin)
Converts a QName into an expanded name using the given namespace maps.

Throws:
XMLValidationException - if the prefix is not declared in any of the given maps

loadXMLSchema

public static void loadXMLSchema(URL url)
                          throws ParseException
Loads an XML schema.

Throws:
ParseException - if a parse error occurs

loadXMLSchema

public static Map<String,SequenceNode> loadXMLSchema(URL url,
                                                     XMLGraph xg)
                                              throws ParseException
Loads an XML schema into an existing XML graph.

Throws:
ParseException - if a parse error occurs

validate

public static void validate(XML x,
                            String type,
                            Origin origin)
                     throws XMLValidationException
Checks that the given template is valid according to the given schema type.

Throws:
XMLValidationException - if the template is invalid


Copyright © 2005-2011 Aarhus University.