MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.xdmio
Class XDMInputFactory

java.lang.Object
  extended by ch.ethz.mxquery.xdmio.XDMInputFactory

public class XDMInputFactory
extends java.lang.Object


Constructor Summary
XDMInputFactory()
           
 
Method Summary
static XMLSource createDOMInput(Context ctx, org.w3c.dom.Node node, QueryLocation location)
          Create an XML input using a DOM node instance.
static XMLSource createSAXInput(Context ctx, org.xml.sax.XMLReader saxInput, QueryLocation location)
          Create an XML input using a SAX/XMLReader instance
static XMLSource createStaxInput(Context ctx, javax.xml.stream.XMLStreamReader staxInput, QueryLocation location)
          Create an XML input using a StAX/XMLStreamReader instance
static XMLSource createTidyInput(Context ctx, java.io.Reader xml, QueryLocation location)
          Create an XHTML input from a character stream provided by a Reader.
static XMLSource createUpdateableDOMInput(XQStaticContext ctx, org.w3c.dom.Node node, QueryLocation location)
          Create an updateable XML input by binding against a DOM node instance.
static XMLSource createXMLInput(Context ctx, java.io.Reader xml, boolean doc, int valMode, QueryLocation location)
          Create an XML input from a character stream provided by a Reader.
static XMLSource createXPPInput(Context ctx, org.xmlpull.v1.XmlPullParser pullParser, QueryLocation loc)
          Create an XML input using an XML Pull Parser instance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDMInputFactory

public XDMInputFactory()
Method Detail

createXMLInput

public static XMLSource createXMLInput(Context ctx,
                                       java.io.Reader xml,
                                       boolean doc,
                                       int valMode,
                                       QueryLocation location)
                                throws MXQueryException
Create an XML input from a character stream provided by a Reader. The exact type of parser used is determine by the engine, this setting can be changed using Context.globalContext.setParserType()

Parameters:
ctx - The context in which the input should run
xml - A Reader producing a character stream
doc - Shall the result be treated as document or as element (the latter is not supported by all parsers)
valMode - The type of validation that should be performed on the input, can be Context.NO_VALIDATION, Context.DTD_VALIDATION, Context.NO_VALIDATION, Context.SCHEMA_VALIDATION_LAX, Context.SCHEMA_VALIDATION_STRICT
location - The location of input in the query, set to QueryLocation.OUTSIDE_QUERY_LOC if not required
Returns:
A MXQuery Iterator representing the input
Throws:
MXQueryException

createXPPInput

public static XMLSource createXPPInput(Context ctx,
                                       org.xmlpull.v1.XmlPullParser pullParser,
                                       QueryLocation loc)
                                throws MXQueryException
Create an XML input using an XML Pull Parser instance

Parameters:
ctx - The context in which the input should run
pullParser - A XML Pull Parser instance
loc - The location of input in the query, set to QueryLocation.OUTSIDE_QUERY_LOC if not required
Returns:
A MXQuery Iterator representing the input
Throws:
MXQueryException

createStaxInput

public static XMLSource createStaxInput(Context ctx,
                                        javax.xml.stream.XMLStreamReader staxInput,
                                        QueryLocation location)
                                 throws MXQueryException
Create an XML input using a StAX/XMLStreamReader instance

Parameters:
ctx - The context in which the input should run
staxInput - A StAX/XMLStream Reader
location - The location of input in the query, set to QueryLocation.OUTSIDE_QUERY_LOC if not required
Returns:
A MXQuery Iterator representing the input
Throws:
MXQueryException

createSAXInput

public static XMLSource createSAXInput(Context ctx,
                                       org.xml.sax.XMLReader saxInput,
                                       QueryLocation location)
                                throws MXQueryException
Create an XML input using a SAX/XMLReader instance

Parameters:
ctx - The context in which the input should run
saxInput - A SAX/XML Reader
location - The location of input in the query, set to QueryLocation.OUTSIDE_QUERY_LOC if not required
Returns:
A MXQuery Iterator representing the input
Throws:
MXQueryException

createDOMInput

public static XMLSource createDOMInput(Context ctx,
                                       org.w3c.dom.Node node,
                                       QueryLocation location)
                                throws MXQueryException
Create an XML input using a DOM node instance. The DOM is read into MXQuery, but never changed

Parameters:
ctx - The context in which the input should run
node - A DOM node
location - The location of input in the query, set to QueryLocation.OUTSIDE_QUERY_LOC if not required
Returns:
A MXQuery Iterator representing the input
Throws:
MXQueryException

createUpdateableDOMInput

public static XMLSource createUpdateableDOMInput(XQStaticContext ctx,
                                                 org.w3c.dom.Node node,
                                                 QueryLocation location)
                                          throws MXQueryException
Create an updateable XML input by binding against a DOM node instance. Changes to the XDM are propagated to the DOM

Parameters:
ctx - The context in which the input should run
node - A DOM node
location - The location of input in the query, set to QueryLocation.OUTSIDE_QUERY_LOC if not required
Returns:
A MXQuery Iterator representing the input
Throws:
MXQueryException

createTidyInput

public static XMLSource createTidyInput(Context ctx,
                                        java.io.Reader xml,
                                        QueryLocation location)
                                 throws MXQueryException
Create an XHTML input from a character stream provided by a Reader. The character stream does not need to be well-formed, it will be automatically corrected

Parameters:
ctx - The context in which the input should run
xml - A Reader producing a character stream
location - The location of input in the query, set to QueryLocation.OUTSIDE_QUERY_LOC if not required
Returns:
A MXQuery Iterator representing the input
Throws:
MXQueryException

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich