[xsl] Processing types of type QName

Subject: [xsl] Processing types of type QName
From: Dan Vint <dvint@xxxxxxxxx>
Date: Tue, 19 Aug 2003 07:10:44 -0700


We are considering the use of QName types for our enumerated values (code lists). We want to be able to determine the standard values from those added by members, so we want member values to be prefixed.

In theory this seems to work nice, but in XSLT it doesn't seem to allow for the normal processing that I would expect. I would really expect to be able to use name(), local-name(), etc against the text() node value but that doesn't seem to work. Is this something that I have to wait for v2 of XSLT?

Our code values are in the element content, so an element is of an enumerated type. If I use a template that matches this element, a simple <xsl:value-of select='.'/> gets me the code value acord:A, <xsl:value-of select="name(.)"/> gets me the element name of the template match statement. <xsl:value-of select="name(text())"/> gets a value of #text in Stylus studio.

I can use the starts-with() function to detect a standard prefix, and contains() to detect a prefix of given value or at least the use of the ':', but I would really like a more flexible approach and I need to be able to translate the prefix back into the namespace URI as well.

Any ideas?

..dan




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


Current Thread