Class Message

java.lang.Object
net.sf.saxon.s9api.Message

public class Message extends Object
A Message represents the output of an xsl:message or xsl:assert instruction. The content of a message is always an XDM document node (in the common case of purely textual messages, the document node will have a single text node child).
  • Constructor Details

    • Message

      public Message(XdmNode content, QName errorCode, boolean terminate, Location location)
      Construct a Message. This constructor is used internally by the xsl:message instruction.
      Parameters:
      content - the content of the message
      errorCode - the error code associated with the message
      terminate - true if terminate="yes" was specified on the xsl:message
      location - the location of the xsl:message instruction
  • Method Details

    • getContent

      public XdmNode getContent()
      Get the content of the message
      Returns:
      the content of the message as an XDM document node
    • getStringValue

      public String getStringValue()
      Get the string value of the message. This is a shortcut for getContent().getStringValue(). It returns the content of the message as a string, without XML escaping, and ignoring any XML markup.
      Returns:
      the message as an unescaped string
    • toString

      public String toString()
      Get the message content as a string, using XML serialization with options method="xml", indent="yes", omit-xml-declaration="yes". This is a shortcut for getContent().toString(). The result may include XML markup and XML escaping, though there is no guarantee that it will be a well-formed XML document (it may be a document fragment).
      Overrides:
      toString in class Object
    • getErrorCode

      public QName getErrorCode()
      Get the error code associated with the message. If no error code was supplied in the call of xsl:message or xsl:assert, the default code XTMM9000 or XTMM9001 is used.
      Returns:
      the error code
    • isTerminate

      public boolean isTerminate()
      Ask whether terminate="yes" was specified on the call of xsl:message. For an xsl:assert instruction the value is always true.
      Returns:
      true if the transformation will terminate after the message has been output
    • getLocation

      public Location getLocation()
      Get the location of the xsl:message or xsl:assert instruction within the containing stylesheet
      Returns:
      the location of the originating instruction