|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XAPI-J refinement proposal
Currently in XAPI there is the interface IContent which has the methods
relevant to being a "node" in a parse tree/grove; accessors for parent
and children. Recent work has shown that there would be some benefit to
breaking IContent into IContent (child) and IContainer (parent). Also
there was feedback asking for addContent() to be extended to
appendContent() and insertContent(). This would look like:
package xml;
import java.util.Enumeration;
public interface IContainer
{
public Enumeration getContents();
public void insertContent( IContent aContent, IContent
preceedingContent );
// appendContent() puts aContent at the end of the list
public void appendContent( IContent aContent );
public void removeContent( IContent aContent );
}
AND
package xml;
import java.util.Enumeration;
public interface IContent
{
public void setParent( IContainer aContainer );
public IContainer getParent();
public String getData();
}
So a Document class (not currently part of XAPI-J) would implement
IContainer but not IContent. IElement would implement both. A Text or
Data class would implement only IContent. I don't see how this
interferes with any existing processors. I hope I have not missed
anything.
Another point is IContent.getData(). This is how, for example, PCData
would be retrieved. Grove terminology refers to non marked up text as
"data" so we have getData(). Except for this detail the method could
just as well have been called getText() (which was my first choice),
getString(), or some such.
Any comments?
--
John Tigue
Programmer
jtigue@d...
DataChannel (http://www.datachannel.com)
206-462-1999
begin: vcard fn: John Tigue n: Tigue;John org: Datachannel adr: 10020 Main St.;;#205;Bellevue;WA;98004;USA email;internet: jtigue@d... tel;work: 462-1999 tel;home: 498-4708 x-mozilla-cpt: ;0 x-mozilla-html: FALSE end: vcard
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








