de.init.its.process.re
Class ItsProcessor.BackwardHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
de.init.its.process.re.ItsProcessor.BackwardHandler
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
- Enclosing class:
- ItsProcessor
public static class ItsProcessor.BackwardHandler
- extends org.xml.sax.helpers.DefaultHandler
Content handler to transform ODT Documents with
ITS annotated content back to plain ODT Documents with bookmarks as
placeholders for its data
- Author:
- mkandora
Constructor Summary |
ItsProcessor.BackwardHandler()
Creates a new content handler to transform ITS annotated
ODT documents back to plain ODT document format. |
Method Summary |
void |
characters(char[] ch,
int start,
int length)
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
protected boolean |
isItsElement(java.lang.String qname)
returns true, if it is an ITS element
NOTICE: this forward transformation explicitly sets the surrounding element
as its:span, not text:span, using the its prefix to indicate ITS content. |
protected void |
putItsElement(IitsTagElement parent,
java.util.Map<java.lang.String,java.lang.String> map)
Creates a new its element preserving the hierarchical structure |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ItsProcessor.BackwardHandler
public ItsProcessor.BackwardHandler()
- Creates a new content handler to transform ITS annotated
ODT documents back to plain ODT document format. Each
nested element is converted to a flat bookmark. the structure
is retained except for the deep its annotated content.
while parsing the file, the manager is being created to
preserve the id information to handle the its content
characters
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
- Specified by:
characters
in interface org.xml.sax.ContentHandler
- Overrides:
characters
in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
- Specified by:
startElement
in interface org.xml.sax.ContentHandler
- Overrides:
startElement
in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
endElement
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
- Specified by:
endElement
in interface org.xml.sax.ContentHandler
- Overrides:
endElement
in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
isItsElement
protected boolean isItsElement(java.lang.String qname)
- returns true, if it is an ITS element
NOTICE: this forward transformation explicitly sets the surrounding element
as its:span, not text:span, using the its prefix to indicate ITS content.
otherwise, it would be rather impossible to detect its annotated content, since
text:span is ambigious. this approach has no impact since the generated ODT
document is only used as intermediary format to export and import to XLIFF
- Parameters:
qname
-
- Returns:
putItsElement
protected void putItsElement(IitsTagElement parent,
java.util.Map<java.lang.String,java.lang.String> map)
- Creates a new its element preserving the hierarchical structure
- Parameters:
map
-