public class NamespaceFilter extends XMLFilterImpl
This is particularly useful for JCR exports, as we don't want to pollute bootstrap files,
which could in turn pollute the namespace registries of other instances, or cause conflicts there.
Magnolia's JCR export typically white-lists only sv
and xsi
namespaces.
Constructor and Description |
---|
NamespaceFilter(String... whitelistedNamespaces) |
Modifier and Type | Method and Description |
---|---|
void |
endPrefixMapping(String prefix) |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
org.apache.jackrabbit.commons.xml.ToXmlContentHandler does not honour the prefix mapping
thus exclusions need to be handled here.
|
void |
startPrefixMapping(String prefix,
String uri) |
characters, endDocument, endElement, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, unparsedEntityDecl, warning
public NamespaceFilter(String... whitelistedNamespaces)
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class XMLFilterImpl
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class XMLFilterImpl
SAXException
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class XMLFilterImpl
SAXException
Copyright © 2003–2021 Magnolia International Ltd.. All rights reserved.