xml.writer

function

Library: XML serializer (OMXMLWRITE)
Import : omxmlwrite.xmd

Returns:


Declaration
export markup sink function
   writer empty-tags value switch      empty-tags  optional initial { true }
          utf-8      value switch      utf-8       optional initial { false }
          into       value string sink destination
      

Argument definitions

destination
the string sink where the XML representation of the input markup is written
empty-tags
indicates whether an empty tag should be written as <empty/> or as <empty></empty>
utf-8
indicates if the non-ASCII characters should be encoded as UTF-8 or as numerical character references


Purpose

The markup sink function xml.writer converts its input markup stream into well-formed XML, and writes that XML into its destination argument. The following example demontrates how the function can be used to write an XML file.

  import "omxmlwrite.xmd" prefixed by xml.
  
  process
     do xml-parse scan #main-input
        using output as xml.writer into file "output.xml"
           output #content
     done

Other Library Functions