public class SchemaAutoLoader
extends org.xml.sax.helpers.XMLFilterImpl
implements org.xml.sax.ext.EntityResolver2
Constructor and Description |
---|
SchemaAutoLoader(org.xml.sax.XMLReader parent,
SchemaMapping mapping,
org.gjt.sp.jedit.Buffer requestingBuffer) |
Modifier and Type | Method and Description |
---|---|
void |
forceSchema(java.lang.String baseURI,
java.lang.String schemaURI)
force the schema to use for validation and CompletionInfo.
|
java.util.Map<java.lang.String,CompletionInfo> |
getCompletionInfo()
only Relax NG schemas are supported for the moment
|
org.xml.sax.InputSource |
getExternalSubset(java.lang.String name,
java.lang.String baseURI)
manually implement EntityResolver2 because XMLFilterImpl only
implements EntityResolver, and we need EntityResolver2 for Resolver
to work properly
|
java.lang.String |
getSchemaURL()
this doesn't return the schema bound using xsi:schemalocation nor the
DTD file : only a schema discovered via the SchemaMapping instance.
|
void |
parse(org.xml.sax.InputSource input)
capture system and public ID to find a matching schema mapping,
|
void |
parse(java.lang.String systemId)
capture sytem ID to find a matching schema mapping
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String name,
java.lang.String publicId,
java.lang.String baseURI,
java.lang.String systemId)
manually implement EntityResolver2 because XMLFilterImpl only
implements EntityResolver, and we need EntityResolver2 for Resolver
to work properly
|
void |
setDocumentLocator(org.xml.sax.Locator l)
capture the locator, in case we need to pass it to a schema
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
if this is the root element, try to find a matching schema,
instantiate it and insert it in the parsing chain.
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String ns) |
characters, endDocument, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, unparsedEntityDecl, warning
public SchemaAutoLoader(org.xml.sax.XMLReader parent, SchemaMapping mapping, org.gjt.sp.jedit.Buffer requestingBuffer)
parent
- parent in the XML parsing chainmapping
- schema-mapping rules or null if you plan to force the schemapublic void forceSchema(java.lang.String baseURI, java.lang.String schemaURI) throws org.xml.sax.SAXException, java.io.IOException, java.net.URISyntaxException
baseURI
- baseURI to resolve the schemaURI against (may be null if schemaURI is absolute)schemaURI
- URI of the schema to installorg.xml.sax.SAXException
java.io.IOException
java.net.URISyntaxException
public java.lang.String getSchemaURL()
public java.util.Map<java.lang.String,CompletionInfo> getCompletionInfo()
public void parse(org.xml.sax.InputSource input) throws org.xml.sax.SAXException, java.io.IOException
parse
in interface org.xml.sax.XMLReader
parse
in class org.xml.sax.helpers.XMLFilterImpl
input
- input to parseorg.xml.sax.SAXException
java.io.IOException
public void parse(java.lang.String systemId) throws org.xml.sax.SAXException, java.io.IOException
parse
in interface org.xml.sax.XMLReader
parse
in class org.xml.sax.helpers.XMLFilterImpl
systemId
- systemId of the input to parseorg.xml.sax.SAXException
java.io.IOException
public void startPrefixMapping(java.lang.String prefix, java.lang.String ns) throws org.xml.sax.SAXException
startPrefixMapping
in interface org.xml.sax.ContentHandler
startPrefixMapping
in class org.xml.sax.helpers.XMLFilterImpl
org.xml.sax.SAXException
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.XMLFilterImpl
org.xml.sax.SAXException
public org.xml.sax.InputSource resolveEntity(java.lang.String name, java.lang.String publicId, java.lang.String baseURI, java.lang.String systemId) throws org.xml.sax.SAXException, java.io.IOException
resolveEntity
in interface org.xml.sax.ext.EntityResolver2
java.lang.UnsupportedOperationException
- if getEntityResolver() doesn't implement EntityResolver2org.xml.sax.SAXException
java.io.IOException
public org.xml.sax.InputSource getExternalSubset(java.lang.String name, java.lang.String baseURI) throws org.xml.sax.SAXException, java.io.IOException
getExternalSubset
in interface org.xml.sax.ext.EntityResolver2
java.lang.UnsupportedOperationException
- if getEntityResolver() doesn't implement EntityResolver2org.xml.sax.SAXException
java.io.IOException
public void setDocumentLocator(org.xml.sax.Locator l)
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.XMLFilterImpl
installJaxpGrammar(java.net.URI,String,boolean)