Revision [887]

This is an old revision of Serialization made by DavidLee on 2009-11-24 15:55:37.

 

Serialization and Parsing options


There are several global (shell scope) options that control serialization and parsing. These control default parameters used whenever plain text is parsed into XML , and when XML is serialized to text.

Most commands (where noted) can also accept these options which override the shell options for just that command.



Parsing Options


The following global parsing options may be set by the set command.




Serializing Options


The following global serialization options may be set by the set command. These may be overwritten by specific commands.

Options without arguments can be preceded by a + instead of a - to inverse the setting.


Examples


It is not always obvious when parsing or serialization occurs, for example depending on the participants in a pipeline and the xpipe setting, there may or may not be serialization and parsing in a pipeline.

Example: The xcat command will serialize to text then xml2csv will parse text to XML
xcat *.xml | xml2csv


Example: This uses an internal event oriented StAX pipeline and does NOT serialize or parse text XML
set +xpipe
xcat *.xml | xml2csv


Also depending on what technology individual commands use they may be outputing as 'pure XML' or as text.
Even with xpipe set, the external "cat" command requires text input so the xml is serialized and the xpipe is ignored.
set +xpipe
xcat *.xml | cat



How redirection is specified may also affect if XML is serialized or parsed.

For example, the following will serialize to text
xslt -f stylesheet.xsl -i input.xml > file.xml


But this command will NOT serialize to text, but rather construct an XML variable which was never serialized.
It is the TinyTree representation which saxon produces directly from the xslt without a copy or serialization.
xslt -f stylesheet.xsl -i input.xml >{VAR}


Similary the following may not ever produce or parse a text format depending on the implementation of "command".
var=$<(command)

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