Class LMSXmlDocument

java.lang.Object
loci.formats.in.LeicaMicrosystemsMetadata.LMSXmlDocument
Direct Known Subclasses:
LMSCollectionXmlDocument, LMSImageXmlDocument

public abstract class LMSXmlDocument extends Object
This class loads and represents a Leica Microsystems XML document (from file or xml string)
Author:
Constanze Wendlandt constanze.wendlandt at leica-microsystems.com
  • Field Details

  • Constructor Details

  • Method Details

    • getDoc

      public Document getDoc()
    • getFilepath

      public String getFilepath()
    • initFromXmlString

      private void initFromXmlString(String xml)
    • initFromFilepath

      private void initFromFilepath(String filepath)
    • xPath

      public NodeList xPath(String expression)
      Searches the XML document for expressions using xPath.
      Parameters:
      expression - expression in xPath syntax
      Returns:
      list of found nodes
    • xPath

      public NodeList xPath(Node node, String expression)
      Searches a node for expressions using xPath.
      Parameters:
      node - node in which to search
      expression - expression in xPath syntax
      Returns:
      list of found nodes
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAttr

      protected String getAttr(Node node, String attrName)
      Returns the value of an attribute of a node, if existing
      Parameters:
      node - node in which to search for the attribute
      attrName - name of the attribute
      Returns:
    • parseFilePath

      protected String parseFilePath(String refPath)
      Translates Leica XML file paths to absolute url decoded paths
      Parameters:
      refPath - path string found in Leica XML reference
      Returns:
      absolute, url decoded path
    • nodeToString

      public String nodeToString(Node node)
    • GetChildWithName

      protected Node GetChildWithName(Node node, String name)
    • getParentFiles

      public List<String> getParentFiles()
      Returns all files which directly or indirectly reference this LMS xml file.
      Returns:
      list of LMS xml documents (xlef and optionally xlcfs)
    • fileExists

      protected static String fileExists(String path)
      Checks if file at path exists and corrects paths to be case sensitive
      Parameters:
      path - whole file path