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 |
---|---|
void |
attribute(NodeName nameCode,
SimpleType typeCode,
java.lang.CharSequence value,
Location locationId,
int properties)
Notify an attribute.
|
static java.lang.CharSequence |
escapeURL(java.lang.CharSequence 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 typeCode,
Location location,
int properties)
Notify the start of an element
|
append, characters, close, comment, endDocument, endElement, getNamePool, getNextReceiver, namespace, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, 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 ReceiverOptions
XPathException
- if an error occurspublic void startElement(NodeName nameCode, SchemaType typeCode, Location location, int properties) throws XPathException
startElement
in interface Receiver
startElement
in class ProxyReceiver
nameCode
- integer code identifying the name of the element within the name pool.typeCode
- integer code identifying the element's type within the name pool.location
- properties
- properties of the element nodeXPathException
- if an error occurspublic void attribute(NodeName nameCode, SimpleType typeCode, java.lang.CharSequence value, Location locationId, int properties) throws XPathException
attribute
in interface Receiver
attribute
in class ProxyReceiver
nameCode
- The name of the attributetypeCode
- The type of the attributelocationId
- the location of the node in the source, or of the instruction that created itproperties
- Bit significant value. The following bits are defined:
value
- the string value of the attributeIllegalStateException:
- attempt to output an attribute when there is no open element
start tagXPathException
- if an error occurspublic static java.lang.CharSequence escapeURL(java.lang.CharSequence url, boolean normalize, Configuration config) throws XPathException
url
- the URI to be escapednormalize
- XPathException
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.