Re: [xsl] design question on function namespaces

Subject: Re: [xsl] design question on function namespaces
From: Bruce D'Arcus <bdarcus@xxxxxxxxx>
Date: Tue, 3 May 2005 09:15:08 -0400
On May 3, 2005, at 8:58 AM, Michael Kay wrote:

The thinking here is that it's often useful to create a library of reusable
functions that compute derived data from your source document: for example,
"does this chapter have any footnotes" or "how many columns are there in
this table" or "is this employee in the pension scheme" or "get all the
products that this customer has bought". You should think of these as
methods associated with the element in question (even though there's no
encapsulation or inheritance), and recognize the link between code and data
by matching up the namespace.

Yes, I understand this. But say you want to implement a function for your "does this chapter have any footnotes" example, but you deal with DocBook NG, TEI 5 and OpenOffice. Would you reimplement the function three times, or would there be a way to make it generic so that it could be reused across the different document types and namespaces. If you do the former, then they're not THAT reusable.


My thinking here is partly conditioned by learning more about the SRU and SRW search and retrieve protocols, and their CQL query language, all of which come out of the library world. There you have abstract queries defined in indices. So, if you query the Library of Congress SRU (RESTful) server, you don't do "mods:titleInfo/mods:title="whatever"; you do "title=whatever" and let the server determine what to do with that.

Example:

http://z3950.loc.gov:7090/Voyager?
operation=searchRetrieve&version=1.1&query=dc.title=XSLT&recordSchema=mo
ds&startRecord=1&maximumRecords=20

I know XSLT presents limitations to implement this sort of thing, but I guess I'm thinking about the possibility of a similar sort of abstract functions -- like "bib:getYearIssued" -- that could be extended to take different input sources.

Bruce

Current Thread