public class HTMLURIEscaper extends ProxyReceiver
Modifier and Type | Field and Description |
---|---|
protected NodeName |
currentElement |
protected boolean |
escapeURIAttributes |
protected NamePool |
pool |
nextReceiver
pipelineConfiguration, previousAtomic, systemId
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
Constructor and Description |
---|
HTMLURIEscaper(Receiver nextReceiver) |
Modifier and Type | Method and Description |
---|---|
void |
attribute(NodeName nameCode,
SimpleType typeCode,
CharSequence value,
int locationId,
int properties)
Notify an attribute.
|
static CharSequence |
escapeURL(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,
int locationId,
int properties)
Notify the start of an element
|
append, characters, close, comment, endDocument, endElement, getNamePool, getUnderlyingReceiver, namespace, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, usesTypeAnnotations
append, getConfiguration, getPipelineConfiguration, getSystemId
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, int locationId, 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.properties
- properties of the element nodelocationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.XPathException
- if an error occurspublic void attribute(NodeName nameCode, SimpleType typeCode, CharSequence value, int locationId, int properties) throws XPathException
attribute
in interface Receiver
attribute
in class ProxyReceiver
nameCode
- The name of the attribute, as held in the name pooltypeCode
- The type of the attribute, as held in the name poolproperties
- Bit significant value. The following bits are defined:
value
- the string value of the attributelocationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.IllegalStateException:
- attempt to output an attribute when there is no open element
start tagXPathException
- if an error occurspublic static CharSequence escapeURL(CharSequence url, boolean normalize, Configuration config) throws XPathException
url
- the URI to be escapednormalize
- XPathException
Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.