msv module

msv module provides functions operate on XML documents, which are compatible with the function of the pnuts.xml module.

XML schema validation is done with Sun Multi-Schema XML Validator.

parseXML(
( InputStream | Reader | String | File | URL | org.xml.sax.InputSource ) input ,
( Map | org.xml.sax.ContentHandler) handler
  { , Map properties { , (String | File | URL ) schama } } )

parseXML() parses a XML documents reading from input. Notification from the parser is handled by handler.

When handler is a Map object, the keys must be a method name of org.xml.sax.helpers.DefaultHandler, and the values must be a function that has the same number of arguments as the method.

properties are used for configuring the parser, which can include the following boolean properties.

namespaceAware
validating

When properties includes other key-value mappings, they are treated as SAX parser's properties.

When schama is specified, the XML document is parsed with schama validation.

readDocument(
{ , Map properties { , (String | File | URL ) schama } })

readDocument() reads a XML document and returns a DOM object as a org.w3c.dom.Document object.

properties can include the following boolean properties, which are Bean properties of javax.xml.parsers.DocumentBuilderFactory.

namespaceAware
validating
ignoringElementContentWhitespace
expandEntityReferences
ignoringComments
coalescing

When properties includes other key-value mappings, they are treated as DOM builder's attributes.

When schama is specified, the XML document is parsed with schama validation.