<p dir="ltr">I just love to do .[1][1][1][1][1][1][1]</p>
<div class="gmail_extra"><br><div class="gmail_quote">Op 31 okt. 2016 19:19 schreef "Michael Kay" <<a href="mailto:mike@saxonica.com">mike@saxonica.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I agree with the other respondents: apart from giving an error if the context item is not a node, "./." is precisely equivalent to ".".<br>
<br>
(Not sure why an XSLT question is appearing on the XQuery list...)<br>
<br>
There's a certain fondness for verbosity in some parts of the XSLT user community. It's quite common to see "./price" where "price" would serve perfectly well, or "price/text()" for "price"; or xsl:element and xsl:attribute used where literal result elements would do the job, or (my favourite gripe)<br>
<br>
<xsl:variable name="x"><br>
  <xsl:value-of select="count(y)"/><br>
</xsl:variable><br>
<br>
where <xsl:variable name="x" select="count(y)"/> would serve the purpose better.<br>
<br>
And of course we've all seen things like <xsl:if test="contains(x, y) = true()">.<br>
<br>
I think some XSLT programmers must be paid by the yard; alternatively the language attracts those who love the sourd of their own keyboard. But "./." isn't an expansion I have seen before.<br>
<br>
Michael Kay<br>
Saxonica<br>
<br>
> On 31 Oct 2016, at 16:52, Schwartz, Christine <<a href="mailto:christine.schwartz@ptsem.edu">christine.schwartz@ptsem.edu</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I'm hoping someone on this list can clarify my conundrum.<br>
><br>
> I'm working with a colleague on a writing project and one of his examples uses this XPath syntax "./." in the starts-with() function within an XSLT stylesheet. I don't know what "./." means. I would think that "." alone would be sufficient to refer to the context node.<br>
><br>
> Here's the example:<br>
><br>
> <xsl:for-each select="//dim:field"><br>
>    <xsl:if test="./@element='title'"><br>
>       <xsl:choose><br>
>          <xsl:when test="starts-with(./.,'The ')"><br>
>                <datafield tag="245" ind1="1" ind2="4"><br>
>                       <subfield code="a"><xsl:value-of select="."/>.</subfield><br>
>                </datafield><br>
>          </xsl:when><br>
>          <xsl:when test="starts-with(./.,'An ')"><br>
>                <datafield tag="245" ind1="1" ind2="3"><br>
>                       <subfield code="a"><xsl:value-of select="."/>.</subfield><br>
>                </datafield><br>
>          </xsl:when><br>
>          <xsl:when test="starts-with(./.,'A ')"><br>
>                <datafield tag="245" ind1="1" ind2="2"><br>
>                       <subfield code="a"><xsl:value-of select="."/>.</subfield><br>
>                </datafield><br>
>          </xsl:when><br>
>          <xsl:otherwise><br>
>               <datafield tag="245" ind1="1" ind2="0"><br>
>                     <subfield code="a"><xsl:value-of select="."/>.</subfield><br>
>               </datafield><br>
> Thanks,<br>
><br>
> Chris<br>
><br>
> Christine Schwartz<br>
> Metadata Librarian and XML Database Administrator<br>
> Princeton Theological Seminary<br>
> Library<br>
> P.O. Box 821<br>
> Princeton, NJ 08542<br>
> <a href="mailto:christine.schwartz@ptsem.edu">christine.schwartz@ptsem.edu</a><br>
> (609) 497-7938<br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> <a href="mailto:talk@x-query.com">talk@x-query.com</a><br>
> <a href="http://x-query.com/mailman/listinfo/talk" rel="noreferrer" target="_blank">http://x-query.com/mailman/<wbr>listinfo/talk</a><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
<a href="mailto:talk@x-query.com">talk@x-query.com</a><br>
<a href="http://x-query.com/mailman/listinfo/talk" rel="noreferrer" target="_blank">http://x-query.com/mailman/<wbr>listinfo/talk</a><br>
</blockquote></div></div>