Commit 08358bcc authored by Wendell Piez's avatar Wendell Piez

Cf issue xsweet:#160: repaired XSLT plus XSpec unit tests (not implemented yet)

parent eeef3944
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec"
stylesheet="ucp-text-macros.xsl" xmlns="http://www.w3.org/1999/xhtml">
<x:scenario label="Big Grab Bag">
<x:context>
<html>
<head>
<meta charset="UTF-8"/>
</head>
<body>
<div class="docx-body">
<p>
<span class="tab"><!-- tab --></span>
</p>
<p>Paragraph above is just a tab</p>
<p>"'quote'"</p>
<p>'"quote"'</p>
<p>'”quote"‘</p>
<p>‘"quote"’</p>
<p>""quote""</p>
<p>—”</p>
<p>“—</p>
<p>’ quotation ’</p>
<p><!-- empty --></p>
<h2 style="font-family: Helvetica; font-weight: bold">These work:</h2>
<p>"straight quotes"</p>
<p>straight apostrophe'</p>
<p>don't</p>
<p>don‘t</p>
<p>don’t</p>
<p>'simple'</p>
<p>`quote`</p>
<p>``quote``</p>
<p>‘qoutation‘</p>
<p>“quotation“</p>
<p>’quotation’</p>
<p>”quotation”</p>
<p>”quotation``</p>
<p>``quotation”</p>
<p><!-- empty --></p>
<p>sentence with punctuations separated by space .</p>
<p>sentence with punctuations separated by space !</p>
<p>sentence with punctuations separated by space ,</p>
<p>sentence with punctuations separated by space ,</p>
<p>sentence with punctuations separated by space ;</p>
<p>sentence with punctuations separated by space ?</p>
<p>sentence with punctuations separated by 3 spaces ?</p>
<p><!-- empty --></p>
<p><!-- empty --></p>
<p><b>this is all bold except for the period</b>.</p>
<p><i>this is all italics except for the period</i>.</p>
<p>
<span style="font-family: Helvetica">
<u>this is all underlined</u>
</span>
<a class="bookmarkStart" id="docx-bookmark_0"><!-- bookmark ='_GoBack'--></a>
<a href="#docx-bookmark_0"><!-- bookmark end --></a>
<span style="font-family: Helvetica"><u> except for the period</u>.</span>
</p>
<p><!-- empty --></p>
<p>Summer of '69</p>
<p>Summer of ‘69</p>
<p><!-- empty --></p>
<p>W.E.B. Dubois</p>
<p>E. B. White</p>
<p><!-- empty --></p>
<p>U.S.</p>
<p>D.C.</p>
<p>A.M.</p>
<p>P.M.</p>
<p>A.D.</p>
<p>B.C.</p>
<p>B.C.E.</p>
<p>A.C.E.</p>
</div> </body>
</html>
</x:context>
<x:expect label="With links marked up in line">
<html>
<head>
<meta charset="UTF-8" />
</head>
<body>
<div>
<p>
<b>Here's some</b>
<b> bold for</b>
<b>you</b>.</p>
<h1>Substitution macros</h1>
<p>...the lion sleeps tonight...</p>
<p>
<a href="http://www.wendellpiez.com">www.wendellpiez.com</a>
</p>
<p>there's a file at ... file:/D:/Work/Projects/Customers/Coko/Data/url-reading-testing.html</p>
<p>Hyperlink inferencing might work on any domain and many file formats</p>
<p>
<a href="http://http:where.are.we.now.com">http:where.are.we.now.com</a>
</p>
<p>Here's a pretty insane one: <a href="http://www5.iadb.org/mif/ProgramsandProjects/AccesstoFinance/Remittances/tabid/215/language/en-US/Default.aspx">http://www5.iadb.org/mif/ProgramsandProjects/AccesstoFinance/Remittances/tabid/215/language/en-US/Default.aspx</a> okay?</p>
<p>
<a href="http://www.nmta.us/site/page.php?347">http://www.nmta.us/site/page.php?347</a>
</p>
<p>
<a href="http://www.profeco.gob.mx/envio/cuadros.asp">http://www.profeco.gob.mx/envio/cuadros.asp</a>
</p>
<p>
<a href="ftp://ftp.my.site.org">ftp://ftp.my.site.org</a> is also a link!</p>
<p>
<a href="http://www.ime.gob.mx/ime2/images/educacion_financiera/acuerdo_bancos_consulados.pdf">http://www.ime.gob.mx/ime2/images/educacion_financiera/acuerdo_bancos_consulados.pdf</a>
</p>
<p>and finally we have ... <a href="http://sccounty01.co.santa-cruz.ca.us/bds/Govstream/ASP/Display/PdfFinder.asp?Type=Agenda&amp;MeetingDate=20020618&amp;Filename=051.pdf">http://sccounty01.co.santa-cruz.ca.us/bds/Govstream/ASP/Display/PdfFinder.asp?Type=Agenda&amp;MeetingDate=20020618&amp;Filename=051.pdf</a>
</p>
<p>Here's my home page: <a href="http://www.piez.org/wendell">http://www.piez.org/wendell</a>
</p> also <a href="http://pellucidliterature.org">pellucidliterature.org</a>.
</div>
</body>
</html>
</x:expect>
</x:scenario>
</x:description>
......@@ -280,7 +280,13 @@
<!-- permits empty xsw:match as a no-op -->
<xsl:choose>
<xsl:when test="matches(.,'\S')">
<xsl:sequence select="replace($str,string(.),(@replace,'')[1], 's')"/>
<xsl:variable name="replacement" select="if (exists(@replace)) then string(@replace) else ''"/>
<xsl:message>
<xsl:value-of select=" '[' || $str || ']'"/>
<xsl:text> : </xsl:text>
<xsl:value-of select="string(.)"/>
</xsl:message>
<xsl:sequence select="replace($str,string(.),$replacement, 's')"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$str"/>
......@@ -457,7 +463,7 @@
-->
<!-- $livechar is any character except a space or quotation mark (open, close or straight) -->
<xsl:variable name="livechar">[^\s\p{Ps}\p{Pe}"']</xsl:variable>
<xsl:variable name="livechar">[^\s\p{{Ps}}\p{{Pe}}"']</xsl:variable>
<xsl:variable name="singles">['&rsquo;&lsquo;]</xsl:variable>
<xsl:variable name="doubles">["&rdquo;&ldquo;]</xsl:variable>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment