xsl-list
[Top] [All Lists]

RE: [xsl] Determining the context node

2006-04-13 03:24:26
You can get the name of the context node using name(). Saxon has an
extension function saxon:path() which gives you a full path to a node; I
believe there are portable solutions to this problem at

http://www.dpawson.co.uk/xsl/sect2/N6077.html

but it seems to be down.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Allison Bloodworth [mailto:abloodworth(_at_)berkeley(_dot_)edu] 
Sent: 13 April 2006 01:15
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Determining the context node

Hi, 

I sometimes get confused about what the context node is when 
I'm writing a
complicated XSL stylesheet. I'm wondering if someone can 
suggest an easy way
to determine what node I'm on (e.g. by using some code to 
print this info
out to my output)? 

I've tried xsl:copy, xsl:copy-of, and xsl:value-of, but I 
don't want to know
the value of the element, I want to know the name of the 
element (e.g. for
<EventWebsite>www.berkeley.edu</EventWebsite> I want to know 
that I'm on
EventWebsite, not that the value is www.berkeley.edu). Also, 
because most of
my elements contain other elements instead of text, often 
doing xsl:copy
(which is more rational than using copy-of) doesn't get me anything. I
assume there's probably an easy XPath expression for this, 
but even after
doing quite a bit of research I can't find it.

Thanks for any suggestions on this!

Allison Bloodworth
Principal Administrative Analyst
Technology Program Office
University of California, Berkeley
(415) 377-8243
abloodworth(_at_)berkeley(_dot_)edu




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--