Saxon.Api

 

 

Saxon.Api

Class Message


public class Message

A Message represents the output of an xsl:message or xsl:assert instruction.

Constructor Summary

Message (XdmNode content, QName errorCode, bool terminate, Location location)

Constructor for use by the xsl:message and xsl:assert instructions: intended for system use.

 

Property Summary

 XdmNode Content

The content of the message: always an XDM document node

 QName ErrorCode

The error code associated with the message. Defaults to err:XTMM9000 for xsl:message, or err:XTMM9001 for xsl:assert.

 Location Location

Information about the location of the originating xsl:message or xsl:assert instruction in the stylesheet.

 string StringValue

The content of the message as a string. This is a shortcut for Content.StringValue. It returns the content of the message as a string, without XML escaping, and ignoring any XML markup.

 bool Terminate

Indicates whether the transformation will terminate after issuing this message. True if xsl:message was called with terminate="yes", or for any activated call on xsl:assert.

 

Method Summary

 string ToString ()

Get the content of the message as a string, using XML serialization. This is a shortcut for Content.ToString(). It returns the content of the message serialized with options method="xml", indent="yes", omit-xml-declaration="yes". There is no guarantee that the result will be a well-formed XML document (it may be a document fragment).

 

Constructor Detail

Message

public Message(XdmNode content,
               QName errorCode,
               bool terminate,
               Location location)

Constructor for use by the xsl:message and xsl:assert instructions: intended for system use.

Parameters:

content - The content of the message as an XDM document node
errorCode - The error code
terminate - True if the transformation will terminate after this message
location - The location in the stylesheet of the originating instruction

Property Detail

Content

public XdmNode Content {get; }

The content of the message: always an XDM document node

If the message has simple textual content, then ToString will extract this.

ErrorCode

public QName ErrorCode {get; }

The error code associated with the message. Defaults to err:XTMM9000 for xsl:message, or err:XTMM9001 for xsl:assert.

Location

public Location Location {get; }

Information about the location of the originating xsl:message or xsl:assert instruction in the stylesheet.

StringValue

public string StringValue {get; }

The content of the message as a string. This is a shortcut for Content.StringValue. It returns the content of the message as a string, without XML escaping, and ignoring any XML markup.

Terminate

public bool Terminate {get; }

Indicates whether the transformation will terminate after issuing this message. True if xsl:message was called with terminate="yes", or for any activated call on xsl:assert.

Method Detail

ToString

public override string ToString()

Get the content of the message as a string, using XML serialization. This is a shortcut for Content.ToString(). It returns the content of the message serialized with options method="xml", indent="yes", omit-xml-declaration="yes". There is no guarantee that the result will be a well-formed XML document (it may be a document fragment).