Native Xml data Macro.

Syntax

Smartsite SXML CopyCode image Copy Code
<se:xmlprocessor />

Parameters

Name Data Type Properties Description
Actions Collection - Sets the actions to perform on the XML object.
AllowDtd Boolean - Sets a value indicating whether to allow DTDs (Doctype definition) within the xml. When transforming xhtml which includes a doctype definition, you need to set this property totrue.
BuildString Boolean - Sets a value indicating whether to build an output string using the code in each action.
By default, the input Xml is manipulated in-place, and the result will be the modified Xml document.
By specifying this value, the result will be constructed by executing the actions and concatenate the results.
Encode Boolean - Sets a value indicating whether to Smartsite.Runtime.Modules.XmlProcessorModule encode the given XML string. Default: true
Fragment Boolean - Sets a value indicating whether this Smartsite.Runtime.Modules.XmlProcessorModule is an XML fragment.
Location Locator - Sets the location of the xml to load.
Namespaces Collection - Sets the namespaces.
PreserveWhitespace Boolean - Sets a value indicating whether to preserve whitespace in the Xml document.
RemoveDuplicateNamespaces Boolean - Sets a value indicating whether to remove duplicate namespaces from the Xml when outputting a string. Duplicate namespace declarations are not illegal, but superfluous, and cause the string representation of the Xml to be larger than needed.
Xml String Trim
Default
Sets the XML.
XmlData XML - Gets the XML object.

Shared Parameters

Name Data Type Properties Description
Access String - Friendly name of the minimum access type level required by the site visitor to execute this macro.
AccessDenied String RawData
Sets the value that is returned when the site visitor has insufficient access.
AIM Enum - Sets the AIM scanning mode of the macro.
Enum values:
  • NotSet
    Not set.
  • Off
    No AIM scanning.
  • External
    Output XML scanning.
  • Internal
    Internal scanning, implemented by AIM-aware macros.
  • Autonomous
    Relations are to be linked to the current source item, instead of the rendered page.
  • SoftLink
    Should generate soft links (in combination with External flag).
  • InternalAutonomous
    Internal scanning, combined with the Autonomous setting.
  • ExternalAutonomous
    External scanning, combined with the Autonomous setting.
  • ExternalAutonomousSoftLink
    External scanning, combined with the Autonomous and softLink settings.
  • ExternalSoftLink
    External scanning, combined with the Softlink setting.
Condition String MustBeAttribute
ExpressionSyntax
XmlDecode
Sets the Viper expression to evaluate before actually executing the macro.
If the expression returns false, the execution of the module and its child modules is skipped.
Default String RawData
Sets the default value that will be returned when the execution would otherwise return an empty string.
Error String RawData
Sets the value to return in case on error occurs during execution.
The Viper expressions this.error(), this.error(full) and this.error(type) are available in this context.
Id String MustBeAttribute
Trim
Sets the Id of the macro. Macros with Ids set can be accessed using Viper by referring to page.[id].[methodname()].
LocalId String MustBeAttribute
Trim
Sets the local id of the macro in the current buffer scope.
Rem String RawData
NoCache
Trim
Sets the remarks. Remarks have no effect on the actual execution of the module.
They only improve the readability of the code.
ResultFormat String RawData
Sets the resultformat.
ResultType Enum - Sets the type of the result.
Enum values:
  • Undefined
    Not set
  • None
    No result
  • String
    Default type
  • Object
    Generic object
  • Binary
    Binary data
  • Boolean
    Boolean
  • DataTable
    DataTable
  • DateTime
    Date/time
  • Float
    Floating point numeric data
  • Integer
    Integer
  • Locator
    Extended Uri
  • Xml
    Xml Data
Save Collection - Sets the buffer names.
Status Enum - Gets a value indicating the ModuleStatus of this module.
Enum values:
  • Unknown
    Unknown
  • BeginInitialize
    Initializing the module
  • EndInitialize
    Module has fully initialized
  • BeginSetProperties
    Properties are about to be set
  • EndSetProperties
    Properties have been set
  • BeginExecute
    Execution starts
  • BeginFormatData
    Starting data formatting.
  • EndFormatData
    Ended data formatting.
  • BeginFormatResult
    Before formating result.
  • EndFormatResult
    After formatting result
  • EndExecute
    Execution is ending
  • StartLoseScope
    Execution has completed
  • EndLoseScope
    Module is about to unload
  • Error
    Module is in an error state
Timeout Float - Sets the timeout in seconds. In the overriden Execute() method, you can call CheckTimeout() to check whether execution has timed out.
Trim Enum MustBeAttribute
Gets a value indicating how the whitespace is trimmed.
Whitespace Enum MustBeAttribute
Gets a value indicating whether to preserve whitespace.
Enum values:
  • Inherit
    Inherit from parent.
  • Preserve
    Keep all whitespace.
  • Remove
    Remove all whitespace.
  • Normalize
    Convert all whitespace to single spaces.
  • SimpleFormat
    Convert all whitespace to single spaces, but keep single line breaks.

Local Viper Methods

Viper Extension Description
This.AppendChild   Appends the given child node at the current node.
This.AppendChildBinary   Appends the given child xml at the current node.
This.AppendChildXml   Appends the given child xml at the current node.
This.ClearForcedResult   Sets the result of the macro.
used to override the normal handling of the result creation.
This.Delete   Deletes the given node(s).
This.Evaluate   Evaluates the given expression at the current Xml node.
This.ExtractBinary   Gets the binary value of the current node as a Binary Data formatted DataTable.
This.GetAttribute   Gets the value of the given attribute on the current Xml node.
This.GetForcedResult   Gets the forced result of the macro, set by overriding the normal rendering using SetForcedResult().
This.GetInnerXml   Gets the inner XML of the current node.
This.GetLocalNodeName   Gets the local node name of the current Xml node.
This.GetNamespaceUri   Gets the current namespace Uri of the current Xml node.
This.GetNodeName   Gets the node name of the current Xml node.
This.GetPrefix   Gets the namespace prefix of the current Xml node.
This.GetTypedValue   Gets the typed node value of the current Xml node.
This.GetValue   Gets the node value of the current Xml node.
This.GetXml   Gets the current Xml node as a new Xml object.
This.InsertAfter   Inserts the given xml after the current node.
This.InsertBefore   Inserts the given xml before the current node.
This.InsertNodeAfter   Inserts the given node after the current node.
This.InsertNodeBefore   Inserts the given node before the current node.
This.PopulateDatatable   Populates the specified datatable with the child nodes below the selected node.
This.RemoveAttribute   Removes an attribute on the given node(s).
This.RemoveNamespace   Removes the given namespace from the current node.
This.RenderTime Returns the render time of the macro in milliseconds.
This.SetAttribute   Adds or sets an attribute on the given node(s).
This.SetForcedResult   Sets the result of the macro.
used to override the normal handling of the result creation.
This.SetInnerXml   Updates the current node's inner Xml. Encodes the given xml.
This.SetNamespace   Sets the default namespace for the current node.
This.SetResult   Sets the result of the processing. Overrules the default return value, being the Xml data.
This.SetValue   Updates the current node's value.
This.Xml   Gets the XML object.

Shared Local Viper Methods

Viper Extension Description
This.AIM.Relations Gets a list of all outgoing AIM relations created by the macro.
This.Buffer.Exists   Checks whether a local buffer exists.
This.Buffer.Get   Gets a local buffer.
This.Buffer.Set   Sets a local buffer.
This.Error.InnerException.Message   Returns the text message of the inner exception of the exception that has occurred.
This.Error.InnerException.SmartsiteCode   Returns Smartsite error code of the inner exception of the exception that has occurred.
This.Error.InnerException.Throw   Makes Smartsite throw the inner exception.
This.Error.InnerException.ToString   Returns the full information of the inner exception of the exception that has occurred, including the stack trace.
This.Error.InnerException.Type   Returns the full Type name of the inner exception of the exception that has occurred.
This.Error.Message   Returns the text message of the exception that has occurred.
This.Error.SmartsiteCode   Returns the Smartsite Error code of the exception that has occurred.
This.Error.Throw   Makes Smartsite throw the current exception.
This.Error.ToString   Returns the full information of the exception that has occurred, including the stack trace.
This.Error.Type   Returns the full Type name of the exception that has occurred.
This.FindExtension   Finds an extension macro.
This.GetParameter Gets the value of the given parameter/property.
This.ParameterExists Checks whether the given parameter/property is set.
This.Result   Returns the result of the macro.
Typically used in the ResultFormat property, to format, convert or encode the result.
This.SXMLPath   Gets the path to the macro in the current execution stack.

Expand image Remarks

Expand image Examples

SXML