<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tei-c.org/index.php?action=history&amp;feed=atom&amp;title=Xpath12match.xslt</id>
	<title>Xpath12match.xslt - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tei-c.org/index.php?action=history&amp;feed=atom&amp;title=Xpath12match.xslt"/>
	<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Xpath12match.xslt&amp;action=history"/>
	<updated>2026-04-21T22:21:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Xpath12match.xslt&amp;diff=6969&amp;oldid=prev</id>
		<title>Piotr Banski: + link</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Xpath12match.xslt&amp;diff=6969&amp;oldid=prev"/>
		<updated>2009-11-03T02:46:09Z</updated>

		<summary type="html">&lt;p&gt;+ link&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 02:46, 3 November 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Proof-of-concept that parses out the xpath1() XPointer scheme from the target= of &amp;lt;certainty&amp;gt;. Just to do something with it, it is re-inserted as a new notXSLT:match= attribute. See the [http://listserv.brown.edu/archives/cgi-bin/wa?S2=TEI-L&amp;amp;q=&amp;amp;s=certainty%2C+%40match%2C+and+XPaths+redux&amp;amp;f=&amp;amp;a=&amp;amp;b= recent thread on TEI-L] for how the output attribute is different from the XSLT match= attribute, and therefore probably should be named something else.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Proof-of-concept that parses out the xpath1() &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/ins&gt;XPointer&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]] &lt;/ins&gt;scheme from the target= of &amp;lt;certainty&amp;gt;. Just to do something with it, it is re-inserted as a new notXSLT:match= attribute. See the [http://listserv.brown.edu/archives/cgi-bin/wa?S2=TEI-L&amp;amp;q=&amp;amp;s=certainty%2C+%40match%2C+and+XPaths+redux&amp;amp;f=&amp;amp;a=&amp;amp;b= recent thread on TEI-L] for how the output attribute is different from the XSLT match= attribute, and therefore probably should be named something else.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Piotr Banski</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Xpath12match.xslt&amp;diff=6935&amp;oldid=prev</id>
		<title>Syd: proof-of-concept parsing out the xpath1() XPointer scheme</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Xpath12match.xslt&amp;diff=6935&amp;oldid=prev"/>
		<updated>2009-10-20T18:54:50Z</updated>

		<summary type="html">&lt;p&gt;proof-of-concept parsing out the xpath1() XPointer scheme&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Proof-of-concept that parses out the xpath1() XPointer scheme from the target= of &amp;lt;certainty&amp;gt;. Just to do something with it, it is re-inserted as a new notXSLT:match= attribute. See the [http://listserv.brown.edu/archives/cgi-bin/wa?S2=TEI-L&amp;amp;q=&amp;amp;s=certainty%2C+%40match%2C+and+XPaths+redux&amp;amp;f=&amp;amp;a=&amp;amp;b= recent thread on TEI-L] for how the output attribute is different from the XSLT match= attribute, and therefore probably should be named something else.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;xsl:stylesheet version=&amp;quot;2.0&amp;quot;&lt;br /&gt;
  xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;&lt;br /&gt;
  xmlns:notXSLT=&amp;quot;http://www.example.org/ns/-1.0&amp;quot;&lt;br /&gt;
  xmlns:tei=&amp;quot;http://www.tei-c.org/ns/1.0&amp;quot; &amp;gt;&lt;br /&gt;
  &amp;lt;!--&lt;br /&gt;
    Proof-of-concept that parsing out an xpath() XPointer scheme from a target= is not all&lt;br /&gt;
    that hard, at least in the simple case. --&amp;gt;&lt;br /&gt;
  &amp;lt;!--&lt;br /&gt;
    No atttempt is made to handle harder cases like multiple pointer parts in the fragment&lt;br /&gt;
    identifier, or an xpath that itself contains '#', or important parts of the fragment&lt;br /&gt;
    identifier are percent-escaped (is that allowed?) --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- &lt;br /&gt;
    I make no claim that this is a good way, let alone the best way, to do this. I only&lt;br /&gt;
    claim that I thought it would work and that it did on my skimpy test data :-) --&amp;gt;&lt;br /&gt;
  &amp;lt;!--&lt;br /&gt;
    Written 2009-10-20 by Syd Bauman&lt;br /&gt;
    Copyright 2009 Syd Bauman and the Brown University Women Writers Project&lt;br /&gt;
    Available under the Creative Commons Attribution-Share Alike 3.0 United States License&lt;br /&gt;
    (See http://creativecommons.org/licenses/by-sa/3.0/us/).&lt;br /&gt;
  --&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- identity transform: anything and everything (except &amp;lt;certainty&amp;gt;, below) becomes itself --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates select=&amp;quot;node()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;@*|node()&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:copy&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:apply-templates select=&amp;quot;@*|node()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/xsl:copy&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- special processing for &amp;lt;certainty&amp;gt; elements that make use of the xpath1() XPointer --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- scheme --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;tei:certainty[contains(@target,'#xpath1')]&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- remember the base URI specified on target= --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;baseURI&amp;quot; select=&amp;quot;substring-before(@target,'#')&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- remember the fragment identifier (which is an XPointer using the xpath1() scheme) --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;fragID&amp;quot; select=&amp;quot;substring-after(@target,'#')&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- parse the actual XPath out of the xpath1() scheme --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Note the attention to whitespace: we can't just use normalize-space() because the --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- XPath scheme itself we are parsing out may have whitespace in it --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;xpath&amp;quot; select=&amp;quot;replace( replace($fragID,'^xpath1\(\s*',''), '\s*\)\s*$','')&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- make a copy of the current &amp;lt;certainty&amp;gt; element ... --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:copy&amp;gt;&lt;br /&gt;
      &amp;lt;!-- ... copy its attrs *except* target= --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:apply-templates select=&amp;quot;@*[ local-name(.) != 'target' ]&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- ... if no base URI on input target=, then don't bother with output target= --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:if test=&amp;quot;normalize-space( $baseURI ) != '' &amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;!-- ... iff there was a base URI on the input target=, use that as --&amp;gt;&lt;br /&gt;
        &amp;lt;!-- the output target= --&amp;gt;&lt;br /&gt;
        &amp;lt;xsl:attribute name=&amp;quot;target&amp;quot;&amp;gt;&amp;lt;xsl:value-of select=&amp;quot;$baseURI&amp;quot;/&amp;gt;&amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;
      &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;
      &amp;lt;!-- ... spit out the XPath we parsed out of the fragment identifier into an attr --&amp;gt;&lt;br /&gt;
      &amp;lt;!-- of its own --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:attribute name=&amp;quot;notXSLT:match&amp;quot;&amp;gt;&amp;lt;xsl:value-of select=&amp;quot;$xpath&amp;quot;/&amp;gt;&amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;
      &amp;lt;!-- ... copy over any content of &amp;lt;certainty&amp;gt; --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:apply-templates select=&amp;quot;node()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/xsl:copy&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:XSLT]]&lt;br /&gt;
[[Category:XSLT:2.0]]&lt;/div&gt;</summary>
		<author><name>Syd</name></author>
		
	</entry>
</feed>