public class Message
extends java.lang.Object
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 and Description |
---|
Message(XdmNode content,
QName errorCode,
boolean terminate,
Location location)
Construct a Message.
|
Modifier and Type | Method and Description |
---|---|
XdmNode |
getContent()
Get the content of the message
|
QName |
getErrorCode()
Get the error code associated with the message.
|
Location |
getLocation()
Get the location of the
xsl:message or xsl:assert
instruction within the containing stylesheet |
java.lang.String |
getStringValue()
Get the string value of the message.
|
boolean |
isTerminate()
Ask whether
terminate="yes" was specified on the
call of xsl:message . |
java.lang.String |
toString()
Get the message content as a string, using XML serialization with options method="xml",
indent="yes", omit-xml-declaration="yes".
|
public Message(XdmNode content, QName errorCode, boolean terminate, Location location)
xsl:message
instruction.content
- the content of the messageerrorCode
- the error code associated with the messageterminate
- true if terminate="yes"
was specified on the xsl:messagelocation
- the location of the xsl:message instructionpublic XdmNode getContent()
public java.lang.String getStringValue()
getContent().getStringValue()
.
It returns the content of the message as a string, without XML escaping, and ignoring any XML markup.public java.lang.String toString()
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).toString
in class java.lang.Object
public QName getErrorCode()
xsl:message
or xsl:assert
,
the default code XTMM9000
or XTMM9001
is used.public boolean isTerminate()
terminate="yes"
was specified on the
call of xsl:message
. For an xsl:assert
instruction
the value is always true.public Location getLocation()
xsl:message
or xsl:assert
instruction within the containing stylesheetCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.