public abstract class XmlPart extends Part
Modifier and Type | Field and Description |
---|---|
protected Document |
doc
This part's XML contents.
|
protected static org.slf4j.Logger |
log |
contentType, partName, relationships
Modifier and Type | Method and Description |
---|---|
String |
cachedXPathGetString(String xpath,
String prefixMappings) |
void |
discardCacheXPathObject() |
abstract Document |
getDocument() |
String |
getXML()
Get the XML as a String.
|
boolean |
isContentEqual(Part other) |
void |
setDocument(Document doc) |
void |
setDocument(InputStream is) |
boolean |
setNodeValueAtXPath(String xpath,
String value,
String prefixMappings)
Set the value of the node referenced in the xpath expression.
|
List<Node> |
xpathGetNodes(String xpathString,
String prefixMappings) |
String |
xpathGetString(String xpathString,
String prefixMappings)
Note: If the result is an empty node-set, it will be converted to an
empty string, rather than null.
|
getContentLengthAsLoaded, getOwningRelationshipPart, getPackage, getRelationshipType, getSourceRelationship, getSourceRelationships, getVersion, remove, rename, setContentLengthAsLoaded, setOwningRelationshipPart, setPackage, setPartShortcut, setRelationshipType, setSourceRelationship, setVersion
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, reset, setContentType, setPartName, setRelationships, setUserData
protected static org.slf4j.Logger log
protected Document doc
public XmlPart(PartName partName) throws InvalidFormatException
InvalidFormatException
public XmlPart() throws InvalidFormatException
InvalidFormatException
public void setDocument(InputStream is) throws Docx4JException
Docx4JException
public void setDocument(Document doc)
public abstract Document getDocument() throws Docx4JException
Docx4JException
public String getXML() throws Docx4JException
Docx4JException
public String xpathGetString(String xpathString, String prefixMappings) throws Docx4JException
xpathString
- prefixMappings
- Docx4JException
public String cachedXPathGetString(String xpath, String prefixMappings) throws Docx4JException
Docx4JException
public void discardCacheXPathObject()
public boolean setNodeValueAtXPath(String xpath, String value, String prefixMappings) throws Docx4JException
xpath
- value
- prefixMappings
- a string such as "xmlns:ns0='http://schemas.medchart'"Docx4JException
public boolean isContentEqual(Part other) throws Docx4JException
isContentEqual
in class Part
Docx4JException
Copyright © 2007-2018. All Rights Reserved.