Progressive documents can be called with the handler “pxml.ashx”, which has the following structure:

http(s)://[Hostname]/(Webanwendung)/pxml.ashx?id=[Pfad zum Datenobjekt]&method=[Methode](&[Parameter]=[Wert])*

In the following example, the progressive XML method “test” is called with the parameter “language”:

https://learn.onion.net/preview/pxml.ashx?id=onion://data/objects/1&method=test&language=de

In the case of progressive documents, the content is only structured at the time of use. This makes it possible to structure elements of any depth. The use of the documents is described by the following example.

A book is stored as shown in the following XML.

<book>
<name>XML: Extensible Markup Language from the begining</name>
<author>Helmut Erlenkötter</author>
<release>Helmut Vonhoegen</release>
<similar>onion://data/objects/14153</similar>
<similar>onion://data/objects/14155</similar>
</book>

The XML object of the book contains exactly one name (the title of the book), one author and one publication date. Moreover, the object can contain any number of links to similar books.

A progressive document is now structured from this information.

The information of the book is to be displayed directly, whilst the information of similar books is to only be available when needed. For this purpose, the XML method “book” is created with the following content.

<xsl:stylesheet xmlns:pro="http://onionworks.net/2004/xml/progressive" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:onion="http://onionworks.net/2004/data" version="1.0">
<xsl:template match="/">
<book title="{book/name}" author="{book/author}" release="{book/release}">
<xsl:for-each select="book/similar">
<similar pro:mode="embed" pro:href="{c.xlink(.,'book')}" />
</xsl:for-each>
</book>
</xsl:template>
</xsl:stylesheet>

This method creates the root element “object” with the attributes “title”, “author” and “release”. Under the element “object”, there are elements of the type “similar” in the number of similar books. So that these elements are only structured when needed, the attributes “pro:mode” und “pro:href” are necessary. The namespace extension xmlns:pro="http://onionworks.net/2004/xml/progressive" is needed for this.

The attribute “pro:mode” can contain the values “replace” or “embed”. The value “replace” leads to the element being overwritten. The value “embed” however leads to the new data being attached. The link to the object to be opened (created with the method “c.xlink”) and its method is to be transferred to the attribute “pro:href”.

When executing the method “book”, you get the following XML at the beginning:

<book title="XML: Extensible Markup Language from the begining" author="Helmut Erlenkötter" release="2003">
<similar pro:mode="embed" pro:href="onion://data/objects/14153#book" />
<similar pro:mode="embed" pro:href="onion://data/objects/14155#book" />
</book>

If the similar books are needed, then these are structured at this point. In the following example, the data of the first similar book was needed:

<book title="XML: Extensible Markup Language von Anfang an" author="Helmut Erlenkötter" release="2003">
<similar pro:mode="embed" pro:href="onion://data/objects/14153#book">
<book title="Einstieg in XML: Aktuelle Standards: XML Schema, XSL, XLink (Galileo Computing)" author="Helmut Vonhoegen" release="2009">
<similar pro:mode="embed" pro:href="onion://data/objects/14155#book" />
<similar pro:mode="embed" pro:href="onion://data/objects/14151#book" />
</book>
</similar>
<similar pro:mode="embed" pro:href="onion://data/objects/14155#book" />
</book>

The data of the first similar book is now available and can be used.