<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Verdana",sans-serif;
        color:#1B0795;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795">Thank you to everyone who answered my question yesterday. I’m glad to know that “./.” is the same as “.” except that the longer version will throw an error if
 the context item is not a node. Since we are teaching beginners, I’m going to suggest to my colleague that we use the shorter version “.” in the example.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795">Also, sorry I wrote to the XQuery list for an XSLT question. I’m just not subscribed to an XSLT list, but really should be. After years of using XQuery as my
 “hammer” I’m starting to use XSLT more when appropriate.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795">Chris<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:#1B0795">Christine Schwartz<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:#1B0795">Metadata Librarian and XML Database Administrator<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:#1B0795">Princeton Theological Seminary Library<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:#1B0795"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1B0795"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> W.S. Hager [mailto:wshager@gmail.com]
<br>
<b>Sent:</b> Monday, October 31, 2016 6:12 PM<br>
<b>To:</b> Michael Kay <mike@saxonica.com><br>
<b>Cc:</b> Schwartz, Christine <christine.schwartz@ptsem.edu>; talk@x-query.com<br>
<b>Subject:</b> Re: [xquery-talk] Unusual XPath syntax question<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p>I just love to do .[1][1][1][1][1][1][1]<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Op 31 okt. 2016 19:19 schreef "Michael Kay" <<a href="mailto:mike@saxonica.com">mike@saxonica.com</a>>:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">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="<a href="mailto:./@element='title'">./@element='title'</a>"><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>
> _______________________________________________<br>
> <a href="mailto:talk@x-query.com">talk@x-query.com</a><br>
> <a href="http://x-query.com/mailman/listinfo/talk" target="_blank">http://x-query.com/mailman/listinfo/talk</a><br>
<br>
<br>
<br>
_______________________________________________<br>
<a href="mailto:talk@x-query.com">talk@x-query.com</a><br>
<a href="http://x-query.com/mailman/listinfo/talk" target="_blank">http://x-query.com/mailman/listinfo/talk</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>