[xsl] Suggestion: transparent id-ref traversal with XPath?

Subject: [xsl] Suggestion: transparent id-ref traversal with XPath?
From: Gunther Schadow <gunther@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 May 2003 16:05:45 -0500
Hi, just to bounce off an idea. Suppose I have this very simplified
use case:


and suppose I am tracking addresses as location objects with lots
of data such as, street, telephone number, GPS location, map drawing,
picture of the front of the builing and other stuff (hey this is
just an example, my real use case is special.) The point is this:
in a significant number of cases one address will be the SAME
(= IDENTICAL) address-object and I may not want to have to repeat
its data for both in an instance. The reason is not just to save
space but also because I know that the two addresses are IDENTICAL
I don't want to send two copies of them.

Now this is easy to do with some ID/IDREF trick:

  <billingAddress id="1">
  <shippingAddress ref="1"/>

when it comes to XSLT and writing XPath expression, however, things
get more complicated now. I now have to add conditional paths that




Wouldn't it be cool if one could somehow specify in XSLT that there
are certain links that XPath could translate?

In this case I could somewhere say:

<x:xpath-view map="order/shippingAddress" select="*[@id=this()/@ref]"/>

and then the XPath engine would handle this transparently? Well,
I suppose I could also do this union instead:


but it is more tedious.


Gunther Schadow, M.D., Ph.D.                    gschadow@xxxxxxxxxxxxxxx
Medical Information Scientist      Regenstrief Institute for Health Care
Adjunct Assistant Professor        Indiana University School of Medicine
tel:1(317)630-7960                         http://aurora.regenstrief.org

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

Current Thread