Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Need to get previous node [Thread Next] Re: Need to get previous nodeTo: NULL Date: 8/6/2009 2:02:00 PM tshad wrote: > When you say current node, are you talking about everything inside the PHOTO > tags? Tags are part of the markup that the XML parser deals with. XSLT operates on a tree of nodes. Within <xsl:template match="FORMPHOTOS/PHOTO"> the current node is a element node with name 'PHOTO'. > Or FORMPHOTOS as well. In otherword, if I change the FORMPHOTOS element to: > > <FORMPHOTOS LABEL="HOUSE"> > > Could I have also accessed the LABEL as: > > <source> > <xsl:value-of select="@HOUSE"/> That does not make much sense. The attribute name is 'LABEL', not 'HOUSE'. And the FORMPHOTOS element is the parent element of the PHOTO element(s) so inside of <xsl:template match="FORMPHOTOS/PHOTO"> to access the LABEL attribute of the FORMPHOTOS element you need to use <xsl:value-of select="../@LABEL"/> > When you say that "Inside of the square brackets the context node is no > longer the PHOTO element but rather that * child element", what is the * > child element refering to? * is a wildcard. You had ../../FIELDS/* and then added a predicate so that predicate applies to any child element of the FIELDS element(s). -- Martin Honnen --- MVP XML http://msmvps.com/blogs/martin_honnen/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
