10.10.2013 Views

XML — Architecture, Tools, Techniques - Department of Computer ...

XML — Architecture, Tools, Techniques - Department of Computer ...

XML — Architecture, Tools, Techniques - Department of Computer ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.4 IBM alphaWorks <strong>XML</strong> Lightweight Extractor<br />

XLE uses a DTD with source annotation (DTDSA). dtdsaCreator provides a GUI for editing.<br />

The idea is that a DTD uniquely produces an <strong>XML</strong> based document if for every iteration with ?,<br />

+, and * and for every selection with | and for PCDATA and CDATA it is known, how many and<br />

which values will be inserted.<br />

A DTDSA extends the DTD with value and binding specifications at the relevant positions. It<br />

helps to load the DTD into dtdsaCreator, edit the necessary specifications, and store the result<br />

as a DTDSA.<br />

<br />

<br />

83<br />

xle/hello.dtd<br />

hello.dtdsa<br />

Strictly speaking the DTD is not correct because as an external DTD it cannot be enclosed by<br />

DOCTYPE. XLE, however, requires DOCTYPE to find the root element, i.e., XLE considers the<br />

DTDSA more or less as a document that just consists <strong>of</strong> the prolog.<br />

In this case there is no database access; therefore XLE can immediately be executed:<br />

$ cd code/xle; alias run=`make run`<br />

$ run XLE hello.dtdsa<br />

<br />

Hello World<br />

<br />

A value specification follows after a colon and must produce the value for a selection with |<br />

and for PCDATA and CDATA. The following constructs can be used:<br />

string "Hello World" string value.<br />

parameter in0 command line argument following the<br />

DTDSA.<br />

field row.column value from the database: row is a variable<br />

set by a binding specification, column is<br />

an attribute name.<br />

function field(table, column, row) value from the database: table selects<br />

the table, column is the attribute name,<br />

row is a variable set by a binding<br />

specification.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!