Class Xmir

  • All Implemented Interfaces:
    com.jcabi.xml.XML

    public final class Xmir
    extends Object
    implements com.jcabi.xml.XML
    Prints XMIR to EO or PHI.

    This class will help you turn XMIR (XML document) into EOLANG plain text source code or PHI calculus expression. It's as simple as this:

     String eo = new Xmir(xml).toEO();
     String phi = new Xmir(xml).toPhi();

    Here, the xml is a String or an instance of XML from the jcabi-xml package.

    • Constructor Detail

      • Xmir

        public Xmir​(com.jcabi.xml.XML src)
        Ctor.
        Parameters:
        src - The source
    • Method Detail

      • xpath

        public List<String> xpath​(String xpath)
        Specified by:
        xpath in interface com.jcabi.xml.XML
      • nodes

        public List<com.jcabi.xml.XML> nodes​(String xpath)
        Specified by:
        nodes in interface com.jcabi.xml.XML
      • registerNs

        public com.jcabi.xml.XML registerNs​(String pfx,
                                            Object uri)
        Specified by:
        registerNs in interface com.jcabi.xml.XML
      • merge

        public com.jcabi.xml.XML merge​(NamespaceContext ctx)
        Specified by:
        merge in interface com.jcabi.xml.XML
      • node

        @Deprecated
        public Node node()
        Deprecated.
        Specified by:
        node in interface com.jcabi.xml.XML
      • inner

        public Node inner()
        Specified by:
        inner in interface com.jcabi.xml.XML
      • deepCopy

        public Node deepCopy()
        Specified by:
        deepCopy in interface com.jcabi.xml.XML
      • validate

        public Collection<SAXParseException> validate​(com.jcabi.xml.XML xsd)
        Specified by:
        validate in interface com.jcabi.xml.XML
      • toEO

        public String toEO()
        Converts XMIR to EO.
        Returns:
        EO representation as String
      • toPhi

        public String toPhi()
        Converts XMIR to PHI.
        Returns:
        PHI representation as String
      • toPhi

        public String toPhi​(boolean conservative)
        Converts XMIR to PHI.
        Parameters:
        conservative - Add empty braces to formations or not
        Returns:
        PHI representation as String.
      • toSaltyPhi

        public String toSaltyPhi()
        Converts XMIR to PHI without any syntax sugar.
        Returns:
        PHI representation as String