RE: [xsl] document() as extension mechanism

Subject: RE: [xsl] document() as extension mechanism
From: "Roger L. Cauvin" <roger@xxxxxxxxxx>
Date: Fri, 20 Jul 2001 15:55:12 -0500
> i recently got some ideas for innovative uses of document()
> in conjunction with custom-written URIResolver's and XSL
> input sources.  (Java only examples, sorry).  Relevant
> questions are at the end of this post.

There is a definite need for the ability to pull data from external sources
into XML documents.  Using the document() function for this purpose is an
interesting idea.

One existing solution is XVRL (see http://www.xvrl.org).  XVRL documents are
XML documents with special tags that refer to external data.

Here is some XVRL that defines a time resolver:

<xvrl:resolver>
  <xvrl:name>timeResolver</xvrl:name>
  <xvrl:class>xvrl/resolver/time/TimeResolver</xvrl:class>
</xvrl:resolver>

Later in the document, you pull in the current hour and minute as follows:

<hour>
  <xvrl:value>
    <xvrl:resolver-name>timeResolver</xvrl:resolver-name>
    <xvrl:method>getHour</xvrl:method>
  </xvrl:value>
</hour>

<minute>
  <xvrl:value>
    <xvrl:resolver-name>timeResolver</xvrl:resolver-name>
    <xvrl:method>getMinute</xvrl:method>
  </xvrl:value>
</minute>

Running the XVRL document through an XVRL parser produces a plain XML
document with the resolved values.

The XVRL parsers at xvrl.org come with built-in resolvers for resolving the
current time, extracting data from relational databases, and "scraping" data
off web pages.

---

Roger L. Cauvin
roger@xxxxxxxxxx



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread