public class HTMLURIEscaper extends ProxyReceiver
Modifier and Type | Field and Description |
---|---|
protected NodeName |
currentElement |
protected boolean |
escapeURIAttributes |
protected NamePool |
pool |
nextReceiver
pipelineConfiguration, previousAtomic, systemId
Constructor and Description |
---|
HTMLURIEscaper(Receiver nextReceiver) |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
escapeURL(java.lang.String url,
boolean normalize,
Configuration config)
Escape a URI according to the HTML rules: that is, a non-ASCII character (specifically,
a character outside the range 32 - 126) is replaced by the %HH encoding of the octets in
its UTF-8 representation
|
boolean |
isUrlAttribute(NodeName element,
NodeName attribute) |
void |
startDocument(int properties)
Start of a document node.
|
void |
startElement(NodeName nameCode,
SchemaType type,
AttributeMap attributes,
NamespaceMap namespaces,
Location location,
int properties)
Notify the start of an element
|
append, characters, close, comment, endDocument, endElement, getNamePool, getNextReceiver, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, usesTypeAnnotations
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getPipelineConfiguration, getSystemId, handlesAppend
protected NodeName currentElement
protected boolean escapeURIAttributes
protected NamePool pool
public HTMLURIEscaper(Receiver nextReceiver)
public void startDocument(int properties) throws XPathException
startDocument
in interface Receiver
startDocument
in class ProxyReceiver
properties
- bit-significant integer indicating properties of the document node.
The definitions of the bits are in class ReceiverOption
XPathException
- if an error occurspublic void startElement(NodeName nameCode, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) throws XPathException
startElement
in interface Receiver
startElement
in class ProxyReceiver
nameCode
- the name of the element.type
- the type annotation of the element.attributes
- the attributes of this elementnamespaces
- the in-scope namespaces of this element: generally this is all the in-scope
namespaces, without relying on inheriting namespaces from parent elementslocation
- an object providing information about the module, line, and column where the node originatedproperties
- bit-significant properties of the element node. If there are no relevant
properties, zero is supplied. The definitions of the bits are in class ReceiverOption
XPathException
- if an error occurspublic static java.lang.String escapeURL(java.lang.String url, boolean normalize, Configuration config) throws XPathException
url
- the URI to be escapednormalize
- true if Unicode normalization (to NFC) is requiredconfig
- the configurationXPathException
- if any error occursCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.