XML formats for LE XML-API
(Linguistic Engine eXtensible Markup Language Applications Programming Interface)
This describes the XML formats for the API. These APIs are used an RPC
(Remote Procedure Call) method over a TCP socket; that is, a client
opens a connection to the LE, sends an XML-encoded expression and then
listens for a response from the LE server. For now, the client's
expressions are very simply a wrapper around a lisp s-expression.
Parse response
This is the format for the reponse from the server if it is returning
a parse. It consists of :
- an agenda, sorted from left to right and from long to short length
- a chart, sorted from left to right and from long to short length
Here is the DTD :
<!ELEMENT parse (agenda,chart)>
<!ELEMENT agenda (span*)>
<!ELEMENT span (object*)>
<!ELEMENT object (feature*)>
<!ELEMENT feature (object*,#PCDATA)>
<!ATTLIST span left CDATA #REQUIRED>
<!ATTLIST span right CDATA #REQUIRED>
<!ATTLIST object name CDATA #REQUIRED>
<!ATTLIST feature name CDATA #REQUIRED>
Here is a sample of XML validated by this DTD:
<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE parse SYSTEM "parse.dtd">
<parse>
<agenda>
<span left="0" right="1">
<object name="hiro">
<feature name="PHON">hiro</feature>
</object>
</span>
<!-- note : overlap -->
<span left="0" right="2">
<object name="hiro sleeps">
<feature name="PHON">hiro sleeps</feature>
</object>
</span>
<span left="0" right="3">
</span>
<span left="1" right="2">
<object name="sleeps">
<feature name="PHON">sleeps</feature>
</object>
</span>
<!-- note : overlap -->
<span left="1" right="3">
<object name="sleeps soundly">
<feature name="PHON">sleeps soundly</feature>
</object>
</span>
<span left="2" right="3">
<object name="soundly">
<feature name="PHON">soundly</feature>
</object>
</span>
</agenda>
<chart>
</chart>
</parse>
Here is a stylesheet for displaying such documents as the above:
parse.xsl
Here is the resulting HTML for the above valid XML and the stylesheet :
parse.html
Eugene Koontz
Last modified: Fri May 10 19:25:38 PDT 2002