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

Re: Access to RowsetSchema attribute

Subject: Re: Access to RowsetSchema attribute
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 23 Oct 2001 14:47:26 +0100
dbtype attribute
Hi Gurnandan,

> Using the following xml fragment, I need to get the value of
> rs:dbtype attribute, assuming that the current context is positioned
> at the attribute z:row/@c1. How do I do it?

Presumably you want to know the data type of the c1 attribute? To get
that you need the value of the rs:dbtype attribute:

  @rs:dbtype

on the s:datatype element:

  s:datatype/@rs:dbtype

under the s:AttributeType element whose name attribute is 'c1':

  s:AttributeType[@name = 'c1']/s:datatype/@rs:dbtype

within the s:ElementType within the s:Schema within the 'xml' [sic]
document element:

 /xml/s:Schema/s:ElementType
   /s:AttributeType[@name = 'c1']/s:datatype/@rs:dbtype

If you don't know the name of the attribute that you want to find the
data type for, then you can use the name() function on the current
attribute to get it, which would make the path:

 /xml/s:Schema/s:ElementType
   /s:AttributeType[@name = name(current())]/s:datatype/@rs:dbtype

If there are lots of s:ElementType elements within the s:Schema, then
you want to choose the one whose name attribute is the same as the
name of the parent of the current attribute node:

 /xml/s:Schema/s:ElementType[@name = name(current()/..)]
   /s:AttributeType[@name = name(current())]/s:datatype/@rs:dbtype

If you're doing this a lot, you might want to set up a key so that you
can quick access to the relevant s:AttributeType element.
   
I hope that's the kind of thing you were after,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.