Revision [1447]

This is an old revision of CommandXunquote made by DavidLee on 2010-06-03 10:22:24.

 

Name

xunquote parses a quoted XML string into an XML.

Synopsis

xunquote [options] [string ...]


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


xunquote unquotes the strings, or if none, unquotes the standard input and outputs as XML, optionally separated 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 parsing XML (see xread to parse XML.

The xunqoute command reverse the result of xquote.

Typical use of xunquote is to parse 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:

xunquote "<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