|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Access to RowsetSchema 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








