[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xt limits patterns for extension function results?

Subject: xt limits patterns for extension function results?
From: Tom Myers <tom.myers@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Mar 2000 10:47:34 -0500
myers 13346
I'm using xt extension functions to generate NodeIterators
which I then process within the stylesheet; it works. 
However, the patterns acceptable for matching the results
are restricted, and I wondered if anybody who has done
this has a notion as to why.

For example, suppose I have a simple document, SampleRow.xml,

<dummy>
  <row>  <field name='Zip'>13346</field>
  <field name='RecTime'>13:40 PM </field>
  <field name='Temp'>37</field>
  <field name='DayLo'>35 </field>
  <field name='DayHi'>46 </field>
....
and so on; a query output representable as a single database row.
Within a stylesheet, I can now say

  <xsl:variable name="docrows" select="document('SampleRow.xml')/*"/>
and the document has been read in;
 <xsl:value-of select="$docrows/row/field[@name='Temp']" />  
is of course 37. If I wanted to write a maximally unreadable
equivalent for "$docrows/row/field[@name='Temp']" I might say

  "$docrows/*[name(.)='row']/*[name(.)='field'][@*='Temp']"

and it would work, as long as each 'field' has only one attribute,
which it does.  Now it happens that I don't want to generate
docrows by reading in an actual file, I want to do it by generating
a NodeIterator:

 <xsl:variable name="rows" select="vdoc:query-result($theSessionID)"/> 

and that's fine...I define queryResult(String sessionID) to return
a NodeIterator, and now I can get the temperature with 

 <xsl:value-of select="$rows/*[name(.)='field'][@*='Temp']" />

(note that we're one level lower down on the corresponding tree.) In
other words, I can use the maximally ugly syntax, but not the natural
syntax that makes XSL reasonably good to use.

Anybody have a thought on what's going on here?
 

Tom Myers 




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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.