public static class LocationAttributes.Pipe extends Object implements ContentHandler
Locator
as attributes.
The purpose of having location as attributes is to allow this information to survive transformations
of the document (an XSL could copy these attributes over) or conversion of SAX events to a DOM.
The location is added as 3 attributes in a specific namespace to each element.
<root xmlns:loc="http://opensymphony.com/xwork/location" loc:src="file://path/to/file.xml" loc:line="1" loc:column="1"> <foo loc:src="file://path/to/file.xml" loc:line="2" loc:column="3"/> </root>Note: Although this adds a lot of information to the serialized form of the document, the overhead in SAX events is not that big, as attribute names are interned, and all
src
attributes point to the same string.LocationAttributes
Constructor and Description |
---|
Pipe()
Create a filter.
|
Pipe(ContentHandler next)
Create a filter that is chained to another handler.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] arg0,
int arg1,
int arg2) |
void |
endDocument() |
void |
endElement(String arg0,
String arg1,
String arg2) |
void |
endPrefixMapping(String arg0) |
void |
ignorableWhitespace(char[] arg0,
int arg1,
int arg2) |
void |
processingInstruction(String arg0,
String arg1) |
void |
setDocumentLocator(Locator locator) |
void |
skippedEntity(String arg0) |
void |
startDocument() |
void |
startElement(String uri,
String loc,
String raw,
Attributes attrs) |
void |
startPrefixMapping(String arg0,
String arg1) |
public Pipe()
public Pipe(ContentHandler next)
next
- the next handler in the chain.public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
public void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
SAXException
public void endElement(String arg0, String arg1, String arg2) throws SAXException
endElement
in interface ContentHandler
SAXException
public void startPrefixMapping(String arg0, String arg1) throws SAXException
startPrefixMapping
in interface ContentHandler
SAXException
public void endPrefixMapping(String arg0) throws SAXException
endPrefixMapping
in interface ContentHandler
SAXException
public void characters(char[] arg0, int arg1, int arg2) throws SAXException
characters
in interface ContentHandler
SAXException
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException
ignorableWhitespace
in interface ContentHandler
SAXException
public void processingInstruction(String arg0, String arg1) throws SAXException
processingInstruction
in interface ContentHandler
SAXException
public void skippedEntity(String arg0) throws SAXException
skippedEntity
in interface ContentHandler
SAXException
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.