Interface CustomXmlPart

All Known Implementing Classes:
BibliographyPart, ComponentsPart, ConditionsPart, CustomXmlDataStoragePart, DocPropsCoverPagePart, JaxbCustomXmlDataStoragePart, QuestionsPart, StandardisedAnswersPart, XPathsPart

public interface CustomXmlPart
There are two types of these: - JaxbCustomXmlDataStoragePart - CustomXmlDataStoragePart This interface doesn't provide getData, because the 2 types are quite different. But it could allow storeItemId to be get or set.
Author:
jharrop
  • Method Details

    • xpathGetString

      String xpathGetString(String xpath, String prefixMappings) throws Docx4JException
      Throws:
      Docx4JException
    • cachedXPathGetString

      String cachedXPathGetString(String xpath, String prefixMappings) throws Docx4JException
      Use org.apache.xpath.CachedXPathAPI, since this is much quicker than default javax.xml.xpath.XPath implementations (Apache's anyway) for large XML files. This is because Apache's old XPathAPI class instantiated a new XPathContext (and thus building a new DTMManager, and new DTMs) each time it was called. XPathAPIObject instead retains its context as long as the object persists, reusing the DTMs. There was the question of whether to declare it here or just implement it in CustomXmlDataStoragePart (since this is mostly of value in binding the user's XML data file). It is here since otherwise BindingHandler would fail on DocPropsCoverPagePart and StandardisedAnswersPart (both of which extend JaxbCustomXmlDataStoragePart).
      Parameters:
      xpath -
      prefixMappings -
      Returns:
      Throws:
      Docx4JException
      Since:
      3.3.1
      See Also:
    • discardCacheXPathObject

      void discardCacheXPathObject()
      Use this to null out the org.apache.xpath.CachedXPathAPI object, which you should do if you've changed your source document, or want to reclaim memory.
      Since:
      3.3.1
    • xpathGetNodes

      List<Node> xpathGetNodes(String xpathString, String prefixMappings) throws Docx4JException
      Throws:
      Docx4JException
    • setNodeValueAtXPath

      boolean setNodeValueAtXPath(String xpath, String value, String prefixMappings) throws Docx4JException
      Parameters:
      xpath -
      prefixMappings -
      value -
      Throws:
      Docx4JException
      Since:
      3.0.1
    • getXML

      String getXML() throws Docx4JException
      Get the XML as a String.
      Throws:
      Docx4JException
      Since:
      3.0.1
    • setXML

      void setXML(Document xmlDocument) throws Docx4JException
      Set the XML data
      Throws:
      Docx4JException
      Since:
      6.0.0
    • getItemId

      String getItemId()
      Since:
      3.0.2