[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Determining the level of the XML node?
At 01/01/16 14:00 -0800, David M. Goudreau wrote:
Does anyone know how to determine what "level" the current node is at in the XML using XSL? If I've understood your use of the word "level", the expression count(ancestors::node()) will give you "1" for the document element, "2" for children of the document element, etc. It also considers an element's attribute as one deeper than the element itself. Use count(ancestors::*) for a zero-origin count. I hope this helps. ................. Ken
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
|