XMLhttp://www.w3.org/XML/ is fast becoming the standard format for passing structured data around the internet, and much general purpose software has been written for tasks such as the parsing, editing, display and transformation of XML data. The XmlChanXmlChan class (a specialised form of ChannelChannel) provides facilities for storing AST objects externally in the form of XML documents, thus allowing such software to be used.
The primary XML format used by the XmlChan class is a fairly close transliteration of the AST native format produced by the basic Channel class. Currently, there is no DTD or schema defining the structure of data produced in this format by an XmlChan. The following is a native AST representation of a simple 1-D FrameFrame (including comments and with the FullFull attribute set to zero so that some default attribute values are included as extra comments):
The corresponding XmlChan output would look like:
Notes:
http://www.starlink.ac.uk/ast/xml/
which will be
inherited by all nested elements.
The XmlChan class changes the default value for the CommentComment and Full attributes (inherited from the base Channel class) to zero and -1, resulting in terse output by default. With the default values for these attributes, the above XML is reduced to the following:
The XmlChan class uses the SkipSkip attributes very similarly to the Channel class. If Skip is zero (the default) then an error will be reported if the text supplied by the source function does not begin with an AST ObjectObject. If Skip is non-zero, then initial text is skipped over without error until the start of an AST object is found. this allows an AST object to be located within a larger XML document.