public class RemovalHandler extends Object
This tool removes SDTs tagged with a certain quantifier from the document part.
Restrictions:
RemovalHandler.Quantifier.ALL
), bindings containing more than one qualifier are
not supported, that is, when you tag od:repeat=/this&od:xpath=/that
, the SDT is removed whenever you
specify to remove either repeat or bind tags. (multiple qualifiers are not recommended in any case!)Modifier and Type | Class and Description |
---|---|
static class |
RemovalHandler.Quantifier
A quantifier specifying kinds of SDTs.
|
Constructor and Description |
---|
RemovalHandler()
Initializes the removal handler.
|
Modifier and Type | Method and Description |
---|---|
void |
removeSDTs(JaxbXmlPart<? extends Object> part)
Removes Structured Document Tags from a document part, preserving their
contents.
|
void |
removeSDTs(JaxbXmlPart<? extends Object> part,
RemovalHandler.Quantifier quantifier,
String... keys)
Removes Structured Document Tags from a document part, preserving their
contents.
|
void |
removeSDTs(WordprocessingMLPackage wordMLPackage)
Removes Structured Document Tags from the main document part, headers, and footer,
preserving their contents.
|
void |
removeSDTs(WordprocessingMLPackage wordMLPackage,
RemovalHandler.Quantifier quantifier,
String... keys)
Removes Structured Document Tags from the main document part, headers, and footer,
preserving their contents.
|
public RemovalHandler()
public void removeSDTs(WordprocessingMLPackage wordMLPackage) throws Docx4JException
wordMLPackage
- The docx package to modify (in situ).Docx4JException
- In case any transformation error occurs.public void removeSDTs(WordprocessingMLPackage wordMLPackage, RemovalHandler.Quantifier quantifier, String... keys) throws Docx4JException
wordMLPackage
- The docx package to modify (in situ).quantifier
- The quantifier regarding which kinds of parts are to be
removed.keys
- In case of RemovalHandler.Quantifier.NAMED
, quantifier names. All
strings except "xpath", "condition", "repeat", "empty" are
ignored.Docx4JException
- In case any transformation error occurs.public void removeSDTs(JaxbXmlPart<? extends Object> part) throws Docx4JException
part
- The document part to modify (in situ).quantifier
- The quantifier regarding which kinds of parts are to be
removed.keys
- In case of RemovalHandler.Quantifier.NAMED
, quantifier names. All
strings except "xpath", "condition", "repeat", "empty" are
ignored.Docx4JException
- In case any transformation error occurs.public void removeSDTs(JaxbXmlPart<? extends Object> part, RemovalHandler.Quantifier quantifier, String... keys) throws Docx4JException
part
- The document part to modify (in situ).quantifier
- The quantifier regarding which kinds of parts are to be
removed.keys
- In case of RemovalHandler.Quantifier.NAMED
, quantifier names. All
strings except "xpath", "condition", "repeat", "empty" are
ignored.Docx4JException
- In case any transformation error occurs.Copyright © 2007-2019. All Rights Reserved.