Class UnparsedTextFunction

    • Constructor Detail

      • UnparsedTextFunction

        public UnparsedTextFunction()
    • Method Detail

      • getSpecialProperties

        public int getSpecialProperties​(Expression[] arguments)
        Description copied from class: SystemFunction
        Determine the special properties of this function. The general rule is that a system function call is non-creative unless more details are defined in a subclass.
        Overrides:
        getSpecialProperties in class SystemFunction
        Parameters:
        arguments - the actual arguments supplied in a call to the function
        Returns:
        the properties
      • readFile

        public static void readFile​(java.net.URI absoluteURI,
                                    java.lang.String encoding,
                                    UniStringConsumer output,
                                    XPathContext context)
                             throws XPathException
        Supporting routine to load one external file given a URI (href) and a baseURI
        Parameters:
        absoluteURI - the absolutized URI
        encoding - the character encoding
        output - the consumer to which the contents of the file will be sent
        context - the XPath dynamic context
        Throws:
        XPathException - if the file cannot be read
      • handleIOError

        public static XPathException handleIOError​(java.net.URI absoluteURI,
                                                   java.io.IOException ioErr)
      • getErrorCode

        public static java.lang.String getErrorCode​(java.io.IOException ioErr)
      • readFile

        public static UnicodeString readFile​(IntPredicateProxy checker,
                                             java.io.Reader reader)
                                      throws java.io.IOException,
                                             XPathException
        Read the contents of an unparsed text file
        Parameters:
        checker - predicate for checking whether characters are valid XML characters
        reader - Reader to be used for reading the file
        Returns:
        the contents of the file, as a UnicodeString
        Throws:
        java.io.IOException - if a failure occurs reading the file
        XPathException - if the file contains illegal characters
      • readFile

        public static void readFile​(IntPredicateProxy checker,
                                    java.io.Reader reader,
                                    UniStringConsumer output)
                             throws java.io.IOException,
                                    XPathException
        Read the contents of an unparsed text file
        Parameters:
        checker - predicate for checking whether characters are valid XML characters
        reader - Reader to be used for reading the file
        output - a consumer object that is supplied incrementally with the contents of the file
        Throws:
        java.io.IOException - if a failure occurs reading the file
        XPathException - if the file contains illegal characters