multivalent.std.adaptor

Class XML

public class XML extends ML

An ever-closer approximation to the XML specification, which itself is a moving target. Handles "xinclude:include". Note: This may be replaced with Sun's XML Parser to pick up namespaces and all the little points of the spec.

XML is used as the storage format for hubs and annotations.

Version: $Revision: 1.6 $ $Date: 2002/10/31 03:12:30 $

Method Summary
static voidencode(String str, StringBuffer sb, boolean q)
Encode characters from str as entity references (e.g., "<" => "<") and write to sb, optionally surrounded by quotes (single quotes if no embedded single quote, else double quotes).
static voidindent(int level, StringBuffer sb)
Write out attribute names in this table first, in this order.
Objectparse(INode parent)
static ESISNodeparseDOM(URI uri)
XML can be also be treated not as a media adaptor but as an XML parsing utility.
static voidwrite(String name, Map<String,Object> attrs, StringBuffer sb, int level)
Write opening tag with generic identifier name and attributes attrs into StringBuffer sb.

Method Detail

encode

public static void encode(String str, StringBuffer sb, boolean q)
Encode characters from str as entity references (e.g., "<" => "<") and write to sb, optionally surrounded by quotes (single quotes if no embedded single quote, else double quotes).

indent

public static void indent(int level, StringBuffer sb)
Write out attribute names in this table first, in this order. Should be a parameter.

parse

public Object parse(INode parent)

parseDOM

public static ESISNode parseDOM(URI uri)
XML can be also be treated not as a media adaptor but as an XML parsing utility. For general XML parsing instead use javax.xml.parsers.SAXParser or javax.xml.parsers.DocumentBuilder.

write

public static void write(String name, Map<String,Object> attrs, StringBuffer sb, int level)
Write opening tag with generic identifier name and attributes attrs into StringBuffer sb. Indent according to nesting level. Does not write a final ">" so client can add more attributes, close tag and add content, or write as empty ("... />").