![]() |
An extensible model for real-time XML processing | Table of contents | Indexes | Programming XML: using the DOM | ![]() |
|||
From markup to object model |
| the XML abstraction problem and XML property objects |
Prescod, Paul ![]() |
| Paul Prescod |
| Consulting Engineer |
Dallas ![]() ISOGEN/DataChannel ![]() Texas ![]() USA ![]() | ISOGEN/DataChannel,
2200 North Lamar Dallas Texas USA 75202 Phone: 214 953 0004 Fax: 214 953 3152 email: paul@isogen.com web site: www.isogen.com |
| Biography |
| Abstract |
Overview |
XML Property Objects |
| This model is universally used and understood in software development. It is also highly amenable to abstraction. |
Mapping XML trees to graphs |
<xpo:template match="html"> <xpo:property name="doctitle" select="head/title"/> <xpo:property name="content" select="body/*"/> </xpo:template> |
<xpo:template match="table"> <xpo:property name="caption" select="caption"/> <xpo:property name="width" select="@width"/> <xpo:property name="height" select="@height"/> <xpo:property name="rows" select="tr"/> <xpo:property name="cells" select="tr/td"/> </xpo:template> |
<xpo:template match="tr"> <xpo:property name="cells" select="td"/> <xpo:property name="table_owner" select=".."/> </xpo:template> |
<xpo:template match="/doc"> <xpo:property name="french_title" select="document(translations/french/@href)/title"/> </xpo:template> |
| Other details: |
Abstraction with XPO |
<xpo:abstract match="html"> <xpo:property name="dublin_core:title" select=".->doctitle"/> <xpo:property name="dublin_core:subject" select=".->keywords"/> <xpo:property name="dublin_core:creator" select=".->author->name"/> </xpo:template> |
| This mechanism is simple both in syntax and in concept. It is highly analogous to delegation in a simple (imaginary) programming language: |
class html_2_dublin_core extends html: def get_dublin_core_title(): return this.get_doctitle() def get_dublin_core_content(): return this.get_content() def get_dublin_core_author(): return this.get_creator().get_author().get_name() |
XPO views |
<xpo:prop-def name="first_name" type="STRING"/> <xpo:prop-def name="initial" type="STRING?"/> <xpo:prop-def name="last_name" type="STRING"/> <xpo:prop-def name="purchases" type="purchase+"/> <xpo:prop-def name="visits" type="INTEGER"/> |
| View declarations are similar to the interface declarations in Java or CORBA. They define a set of properties that are always guaranteed to appear on certain nodes of those properties. |
<xpo:view name="customer"/> <xpo:prop href="#first_name/"> <xpo:prop href="#last_name/"> <xpo:prop href="#inital/"> </xpo:view> |
| View conformance declarations state which nodes adhere to which views. |
<xpo:conforms match="purchase_order/buyer" view="customer"/> |
| This declaration states that elements of type buyer within purchase_order will always have the properties declared by the customer view and they will always have the appropriate types. |
Related technologies |
Transformation languages |
RDF |
| RDF also defines no mechanism for asserting that a single subtree of an XML document conforms to RDF nor for mapping complex XML syntaxes into an RDF model. |
Architectural forms and archetypes |
Data binding |
XLink |
XML Schemas |
Conclusions |
| Bibliography |
|
|
|
|
|
|
|
|
|
|
![]() |
An extensible model for real-time XML processing | Table of contents | Indexes | Programming XML: using the DOM | ![]() | |||