Lists Home |
Date Index |
On Sat, 2002-03-02 at 10:22, Niels Peter Strandberg wrote:
> I want XML in Java!
While poking around on some other projects this morning, I found:
It seems to be running the opposite direction from what Niels wants, but
it's interesting in its own way. I'm not used to seeing "void" in
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.0" class="java.beans.XMLDecoder">
The XML syntax uses the following conventions:
* Each element represents a method call.
* The "object" tag denotes an expression whose value is to be used
as the argument to the enclosing element.
* The "void" tag denotes a statement which will be executed, but
whose result will not be used as an argument to the enclosing method.
* Elements which contain elements use those elements as arguments,
unless they have the tag: "void".
* The name of the method is denoted by the "method" attribute.
* XML's standard "id" and "idref" attributes are used to make
references to previous expressions - so as to deal with circularities in
the object graph.
* The "class" attribute is used to specify the target of a static
method or constructor explicitly; its value being the fully qualified
name of the class.
* Elements with the "void" tag are executed using the outer context
as the target if no target is defined by a "class" attribute.
* Java's String class is treated specially and is written
<string>Hello, world</string> where the characters of the string are
converted to bytes using the UTF-8 character encoding.
Ring around the content, a pocket full of brackets
Errors, errors, all fall down!