com.xml_project.morganaxproc
Class XProcSource

java.lang.Object
  extended by com.xml_project.morganaxproc.XProcSource

public class XProcSource
extends Object

This class is used to hold xml documents to serve as source either for compilation or for documents on input ports.


Constructor Summary
XProcSource(nu.xom.Document document)
           Creates a new XProcSource from the given document.
XProcSource(String uri)
           Creates a new XProcSource which the reference to an xml document.
 
Method Summary
 nu.xom.Document getDocument(XProcSecurityManager.Operations operation, XProcConfiguration config, URI baseURI)
           Return the xml document associated with this XProcSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XProcSource

public XProcSource(String uri)
            throws XProcInterfaceException

Creates a new XProcSource which the reference to an xml document. designated by the uri.

Parameters:
uri - an uri (relative or absolute) to designate an xml document.
Throws:
XProcInterfaceException - if uri is null or an empty string.

XProcSource

public XProcSource(nu.xom.Document document)
            throws XProcInterfaceException

Creates a new XProcSource from the given document.

Parameters:
document - an xml document.
Throws:
XProcInterfaceException - if document is null
Method Detail

getDocument

public nu.xom.Document getDocument(XProcSecurityManager.Operations operation,
                                   XProcConfiguration config,
                                   URI baseURI)
                            throws XProcSecurityException,
                                   IOException,
                                   XProcFilesystem.UnsupportedXMLVersionException,
                                   nu.xom.ValidityException,
                                   nu.xom.ParsingException

Return the xml document associated with this XProcSource.

If the XProcSource was created by new XProcSource(document) this document is returned. Otherwise the given uri is used to obtain a document. If the uri is relative it is made absolute by using baseURI.

Please note that the document is obtained only once from the given uri. Any later change to the document designated by the uri is not reflected. Create a new XProcSource every time you refer to the document if you know that the document was modified since last call of getDocument and always need the current version.

Parameters:
operation - the operation (as defined by XProcSecurityManager for which the document is needed.
config - the XProcConfiguration to be used for obtaining the document from the uri.
baseURI - the baseURI to resolve relative uris.
Returns:
the document associated with this XProcSource.
Throws:
IOException - if there was an error obtaining the document from the given uri.
XProcFilesystem.UnsupportedXMLVersionException - if the document is in an xml version not supported.
nu.xom.ParsingException
nu.xom.ValidityException
XProcSecurityException