Interface IXmlNode

    • Method Detail

      • getName

        String getName()
        Returns:
        name of this node
      • attribute

        String attribute​(String name)
        Try to read value of node attribute with name
        Parameters:
        name - of node attribute
        Returns:
        value of node attribute with name, or value of first in list nodes attribute with name, or null if node or attribute with specific name not exist
      • text

        String text()
        Try to read text content of xml node
        Returns:
        text content of xml node, or text content of first in list xml nodes, or null if node not exist or can't content text
      • xml

        String xml()
        Returns the text content of this node and its descendants
        Returns:
        the text presentation of this node or empty string if this node does not exist
      • path

        String path()
        Returns:
        path to current position in the document, never null
      • size

        int size()
        Returns:
        count of node with specific name

        for example:

         
         <Doc>
           <Page>1</Page>
           <Page>2</Page>
           <Page>3</Page>
         </Doc>
        
         rootXmlNode.get("Doc").size(); // = 1
         rootXmlNode.get("Doc").get("Page").size(); // = 3
         rootXmlNode.get("Doc").get("FireSword").size(); // = 0
         
         
      • get

        IXmlNode get​(int index)
        get child of current xml node at index position
        Parameters:
        index - of child node
        Returns:
        cached and get IXmlNode child node
      • get

        IXmlNode get​(String name)
        get all child nodes of current xml node with specific name
        Parameters:
        name - of child nodes
        Returns:
        cached and get IXmlNode child nodes with specific name
      • get

        IXmlNode get​(String name,
                     int index)
        get child node of current xml node with specific name at index position
        Parameters:
        name - of child node
        index - of child node
        Returns:
        cached and get IXmlNode child nodes with specific name
      • getChildren

        IXmlNode getChildren()
        get children nodes of current xml node
        Returns:
        cached and get IXmlNode children nodes
      • exist

        boolean exist()
        Returns whether this node exists in the xml.
        Returns:
        true if the node exists, otherwise false
      • toModel

        void toModel​(org.eclipse.emf.ecore.EObject context,
                     org.eclipse.emf.ecore.EStructuralFeature feature,
                     Version version,
                     IXmlReadErrorCollector errorCollector)
        Try to set text of current node in model
        Parameters:
        context - EObject
        feature - EStructuralFeature
        version - the version of importing 1C:Enterprise XML files, cannot be null
        errorCollector - IXmlReadErrorCollector in which will be added error if it occur
      • toModel

        void toModel​(String attributeName,
                     org.eclipse.emf.ecore.EObject context,
                     org.eclipse.emf.ecore.EStructuralFeature feature,
                     Version version,
                     IXmlReadErrorCollector errorCollector)
        Try to set attribute of current node in model
        Parameters:
        attributeName - the attribute name of this node to set in model
        context - EObject
        feature - EStructuralFeature
        version - the version of importing 1C:Enterprise XML files, cannot be null
        errorCollector - IXmlReadErrorCollector in which will be added error if it occur
      • withPartReader

        IXmlNode withPartReader​(IXmlPartReader partReader)
        Get handle to this xml node with custom part reader
        Parameters:
        partReader - the IXmlPartReader to read node, cannot be null
        Returns:
        new instance of IXmlNode with specifed IXmlPartReader for read this node hierarchy, never null
      • lookupNamespaceURI

        String lookupNamespaceURI​(String prefix)
        Look up the namespace URI associated to the given prefix, starting from this node.
        Parameters:
        prefix - The prefix to look for. If this parameter is null, the method will return the default namespace URI if any.
        Returns:
        the associated namespace URI or null if none is found or this node not exist