Package fr.becpg.repo.helper
Class XMLDataSourceWriter
java.lang.Object
org.xml.sax.helpers.XMLFilterImpl
org.dom4j.io.XMLWriter
fr.becpg.repo.helper.XMLDataSourceWriter
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler,LexicalHandler,XMLFilter,XMLReader
public class XMLDataSourceWriter
extends org.dom4j.io.XMLWriter
dom4j writer that leaves out the characters XML 1.0 forbids.
dom4j writes a control character as a numeric reference () or as is in a
CDATA section, and both make the document unreadable for the parser on the other side. Such
characters come with text pasted from Word or Teams into any field, so they are dropped here, when
the whole document is written, rather than at each place a value is added.
- Author:
- matthieu
-
Field Summary
Fields inherited from class org.dom4j.io.XMLWriter
DEFAULT_FORMAT, lastOutputNodeType, LEXICAL_HANDLER_NAMES, preserve, writer -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for XMLDataSourceWriter.XMLDataSourceWriter(Writer writer) Constructor for XMLDataSourceWriter. -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected StringescapeElementEntities(String text) protected voidwriteCDATA(String text) Methods inherited from class org.dom4j.io.XMLWriter
characters, close, comment, createWriter, defaultMaximumAllowedCharacter, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, flush, getLexicalHandler, getMaximumAllowedCharacter, getOutputFormat, getProperty, handleException, ignorableWhitespace, indent, installLexicalHandler, isElementSpacePreserved, isEscapeText, isExpandEmptyElements, isNamespaceDeclaration, notationDecl, parse, println, processingInstruction, resolveEntityRefs, setDocumentLocator, setEscapeText, setIndentLevel, setLexicalHandler, setMaximumAllowedCharacter, setOutputStream, setProperty, setResolveEntityRefs, setWriter, shouldEncodeChar, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping, unparsedEntityDecl, write, write, write, write, write, write, write, write, write, write, write, write, write, writeAttribute, writeAttribute, writeAttributes, writeAttributes, writeClose, writeClose, writeComment, writeDeclaration, writeDocType, writeDocType, writeElement, writeElementContent, writeEmptyElementClose, writeEntity, writeEntityRef, writeEscapeAttributeEntities, writeNamespace, writeNamespace, writeNamespaces, writeNamespaces, writeNode, writeNodeText, writeOpen, writePrintln, writeProcessingInstruction, writeStringMethods inherited from class org.xml.sax.helpers.XMLFilterImpl
error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, parse, resolveEntity, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, skippedEntity, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
XMLDataSourceWriter
Constructor for XMLDataSourceWriter.
- Parameters:
out- aOutputStreamobject- Throws:
UnsupportedEncodingException- if any.
-
XMLDataSourceWriter
Constructor for XMLDataSourceWriter.
- Parameters:
writer- aWriterobject
-
-
Method Details
-
escapeElementEntities
- Overrides:
escapeElementEntitiesin classorg.dom4j.io.XMLWriter
-
escapeAttributeEntities
- Overrides:
escapeAttributeEntitiesin classorg.dom4j.io.XMLWriter
-
writeCDATA
- Overrides:
writeCDATAin classorg.dom4j.io.XMLWriter- Throws:
IOException
-