This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

regarding xpath



hi i have the following problem
have an xml file that looks like
<colleges>

<college id = "1">
<name>A College</name>
</college>

<college id = "2">
<name>B College</name>
</college>

<college id = "1">
<name>C College</name>
</college>

</colleges>

to print the college names,
if i write an XPATH expression like
-----------------------------------------------
<xsl:for-each select="/colleges/college/name">
<xsl:value-of select="."/>.
</xsl:for-each>
-----------------------------------------------
OR
-----------------------------------------------
<xsl:for-each select="//colleges/college/name">
<xsl:value-of select="."/>.
</xsl:for-each>
-----------------------------------------------
OR
-----------------------------------------------
<xsl:for-each select="//college/name">
<xsl:value-of select="."/>.
</xsl:for-each>
-----------------------------------------------

for all the above XPATH expressions in select , i seem to be 
getting the names. If so then what is the significant difference 
between the three statements??


the above code is in <xsl:template match = "/"> ( from root )

thanks
_________________________________________________________
Click below to visit monsterindia.com and review jobs in India or 
Abroad
http://monsterindia.rediff.com/jobs


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]