Name

xquote converts XML types into a string.

Synopsis

xquote [options] [expressions]


Options


Supports the standard [ serialization options ]

-nDo not terminate or seperate expressions with a sequence terminator.
-p,-port portOutput to a named port instead of stdout

Description


xquote quotes the expressions, or if none, quotes the standard input and outputs as text, optionally seperated and terminated by the sequence terminator (typically LF).

The result may not be obvious depending on where you are outputing the results. This is not the same as a literal quote, nor is it XML text encoding; rather it is a type conversion. The resultant type, if stored in an XML variable is of type xs:string.

You can use xunquote to reverse the process.

Typical use of xquote is to construct XML messages with string content which contains XML encode XML bodies.
For example a SOAP message which contains a string representation of an XML document.


Example:

xquote <[ <foo>bar</foo> ]>

Result
<foo>bar</foo>


Example
xquote -n <[ <foo>bar</foo> ]> >{var}
xecho <[ <elem>{$var}</elem> ]>


Result
<elem>&lt;foo&gt;bar&lt;/foo&gt;</elem>



Example:
var=<[ <foo>bar</foo> ]>
xtype $var $<(xquote $var)
echo $<(xquote $var)
xecho $<(xquote $var)



Result:
element()
xs:string
<foo>bar</foo>
&lt;foo&gt;bar&lt;/foo&gt;&#xD;


Note that xquote used in combination with xecho will XML Encode the result, wherase using echo will not.




Return Value

Returns 0 if the command is successful

Commands
CategoryCommands
CommandXunquote
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki