Re: Simple API

James Clark (jjc@jclark.com)
Tue, 25 Mar 1997 18:55:30 +0700


At 09:52 25/03/97 GMT, Peter Murray-Rust wrote:

>My own suggestion is that we should produce a ReallySimple API independently
>of the grove approach.

It's perfectly possible to have a "ReallySimple API" that is based on
groves, for example:

public interface Builder {
SgmlDocument build(String url);
}

public interface Node {
public abstract Node getParent();
public abstract NodeList getChildren();
}

public interface NodeList {
public abstract Node getItem(int i);
public abstract int getCount();
}

public interface NamedNodeList {
public abstract Node getItem(String name);
public abstract NodeList toNodeList();
}

public interface SgmlDocument extends Node {
public abstract NodeList getProlog();
public abstract NodeList getEpilog();
public abstract Element getDocumentElement();
public abstract NamedNodeList getElements();
public abstract NamedNodeList getEntities();
}

public interface Element extends Node {
public abstract String getId();
public abstract String getGi();
public abstract NodeList getContent();
public abstract NamedNodeList getAttributes();
public abstract boolean getMustOmitEndTag();
}

public interface DataChar extends Node {
public abstract char getChar();
}

public interface Pi extends Node {
public abstract String getSystemData();
}

public interface ExternalData extends Node {
public abstract Entity getEntity();
}

public interface AttributeAssignment extends Node {
public abstract NodeList getValue();
public abstract boolean getImplied();
public abstract String getName();
}

public interface AttributeValueToken extends Node {
public abstract String getToken();
public abstract Element getReferent();
public abstract Entity getEntity();
public abstract Notation getNotation();
}

public interface Entity extends Node {
public abstract String getName();
public abstract ExternalId getExternalId();
public abstract String getText();
public abstract Notation getNotation();
}

public interface ExternalId extends Node {
public abstract String getSystemId();
public abstract String getPublicId();
}

public interface Notation extends Node {
public abstract String getName();
public abstract ExternalId getExternalId();
}

Is that really so complicated?

James

xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (rzepa@ic.ac.uk)