| 40 | | >>> en.setModernLocation(u'<xsl:apply-templates />') |
|---|
| 41 | | >>> en.getModernLocation() |
|---|
| 42 | | '<xsl:apply-templates />' |
|---|
| | 40 | >>> sourcetext = u'<xsl:apply-templates/>' |
|---|
| | 41 | >>> sourcetext_utf8 = sourcetext.encode('utf8') |
|---|
| | 42 | >>> en.setModernLocation(sourcetext_utf8) |
|---|
| | 43 | >>> resulttext_utf8 = en.getModernLocation() |
|---|
| | 44 | >>> resulttext_utf8 == sourcetext_utf8 |
|---|
| | 45 | True |
|---|
| | 46 | >>> resulttext = unicode(resulttext_utf8, 'utf8') |
|---|
| | 47 | >>> resulttext == sourcetext |
|---|
| | 48 | True |
|---|
| | 49 | >>> resulttext == u'<xsl:apply-templates/>' |
|---|
| | 50 | True |
|---|
| 48 | | >>> en.setTimePeriods([<xsl:value-of select="$timestring"/>]) |
|---|
| 49 | | >>> en.getTimePeriods() |
|---|
| 50 | | (<xsl:value-of select="$timestring"/><xsl:if test="count(../gaz:timePeriod) = 1">,</xsl:if>) |
|---|
| 51 | | </xsl:if> |
|---|
| 52 | | </xsl:template> |
|---|
| | 56 | >>> sourcelist = [<xsl:value-of select="$timestring"/>] |
|---|
| | 57 | >>> en.setTimePeriods(sourcelist) |
|---|
| | 58 | >>> results = en.getTimePeriods() |
|---|
| | 59 | <xsl:for-each select="../gaz:timePeriod"> |
|---|
| | 60 | >>> results[<xsl:value-of select="count(preceding-sibling::gaz:timePeriod)"/>] == '<xsl:value-of select="normalize-space(gaz:timePeriodName)"/>' |
|---|
| | 61 | True |
|---|
| | 62 | </xsl:for-each> |
|---|
| | 63 | </xsl:if> |
|---|
| | 64 | </xsl:template> |
|---|
| | 65 | |
|---|
| 70 | | >>> en.setSecondaryReferences([<xsl:value-of select="$biblstring"/>]) |
|---|
| 71 | | >>> en.getSecondaryReferences() |
|---|
| 72 | | (<xsl:value-of select="$biblstring"/>) |
|---|
| | 83 | >>> sourcelist = [<xsl:value-of select="$biblstring"/>] |
|---|
| | 84 | >>> en.setSecondaryReferences(sourcelist) |
|---|
| | 85 | >>> resultlist = en.getSecondaryReferences() |
|---|
| | 86 | <xsl:for-each select="../tei:bibl"> |
|---|
| | 87 | >>> resultlist[<xsl:value-of select="count(preceding-sibling::tei:bibl)"/>] == sourcelist[<xsl:value-of select="count(preceding-sibling::tei:bibl)"/>].encode('utf8') |
|---|
| | 88 | True |
|---|
| | 89 | </xsl:for-each> |
|---|
| 102 | | >>> en_name.setNameAttested(u'<xsl:apply-templates />') |
|---|
| 103 | | >>> en_name.getNameAttested() |
|---|
| 104 | | u'<xsl:apply-templates />' |
|---|
| | 119 | >>> sourcetext = u'<xsl:apply-templates/>' |
|---|
| | 120 | >>> sourcetext_utf8 = sourcetext.encode('utf8') |
|---|
| | 121 | >>> en_name.setNameAttested(sourcetext_utf8) |
|---|
| | 122 | >>> resulttext_utf8 = en_name.getNameAttested() |
|---|
| | 123 | >>> resulttext_utf8 == sourcetext_utf8 |
|---|
| | 124 | True |
|---|
| | 125 | >>> resulttext = unicode(resulttext_utf8, 'utf8') |
|---|
| | 126 | >>> resulttext == sourcetext |
|---|
| | 127 | True |
|---|
| | 128 | >>> resulttext == u'<xsl:apply-templates/>' |
|---|
| | 129 | True |
|---|
| | 130 | |
|---|
| 129 | | <xsl:choose> |
|---|
| 130 | | <xsl:when test=". = 160"> </xsl:when> <!-- get rid of non-breaking spaces --> |
|---|
| 131 | | <xsl:when test=". > 127">\x<xsl:call-template name="toHex"><xsl:with-param name="decimalNumber"><xsl:value-of select="."/></xsl:with-param></xsl:call-template></xsl:when> |
|---|
| 132 | | <xsl:otherwise><xsl:value-of select="codepoints-to-string(.)"/></xsl:otherwise> |
|---|
| 133 | | </xsl:choose> |
|---|
| | 155 | <xsl:choose> |
|---|
| | 156 | <xsl:when test=". < 128"><xsl:value-of select="codepoints-to-string(.)"/></xsl:when> |
|---|
| | 157 | <xsl:when test=". = 160"><xsl:text> </xsl:text></xsl:when> <!-- get rid of non-breaking spaces --> |
|---|
| | 158 | <xsl:otherwise> |
|---|
| | 159 | <xsl:call-template name="genpythouniesc"> |
|---|
| | 160 | <xsl:with-param name="codepoint-decimal"><xsl:value-of select="."/></xsl:with-param> |
|---|
| | 161 | </xsl:call-template> |
|---|
| | 162 | </xsl:otherwise> |
|---|
| | 163 | </xsl:choose> |
|---|
| | 178 | <xsl:template name="genpythouniesc"> |
|---|
| | 179 | <xsl:param name="codepoint-decimal"/> |
|---|
| | 180 | <xsl:variable name="codepoint-hex"> |
|---|
| | 181 | <xsl:call-template name="toHex"> |
|---|
| | 182 | <xsl:with-param name="decimalNumber"><xsl:value-of select="$codepoint-decimal"/></xsl:with-param> |
|---|
| | 183 | </xsl:call-template> |
|---|
| | 184 | </xsl:variable> |
|---|
| | 185 | <xsl:variable name="hexlen"><xsl:value-of select="string-length(string($codepoint-hex))"/></xsl:variable> |
|---|
| | 186 | <xsl:text>\U</xsl:text><xsl:value-of select="concat(substring('00000000', 1, 8-$hexlen), string($codepoint-hex))"/> |
|---|
| | 187 | </xsl:template> |
|---|
| 153 | | <xsl:param name="decimalNumber" /> |
|---|
| 154 | | <xsl:if test="$decimalNumber >= 16"> |
|---|
| 155 | | <xsl:call-template name="toHex"> |
|---|
| 156 | | <xsl:with-param name="decimalNumber" |
|---|
| 157 | | select="floor($decimalNumber div 16)" /> |
|---|
| 158 | | </xsl:call-template> |
|---|
| 159 | | </xsl:if> |
|---|
| 160 | | <xsl:value-of select="substring($hexDigits, |
|---|
| 161 | | ($decimalNumber mod 16) + 1, 1)" /> |
|---|
| | 193 | <xsl:param name="decimalNumber" /> |
|---|
| | 194 | <xsl:if test="$decimalNumber >= 16"> |
|---|
| | 195 | <xsl:call-template name="toHex"> |
|---|
| | 196 | <xsl:with-param name="decimalNumber" |
|---|
| | 197 | select="floor($decimalNumber div 16)" /> |
|---|
| | 198 | </xsl:call-template> |
|---|
| | 199 | </xsl:if> |
|---|
| | 200 | <xsl:value-of select="substring($hexDigits, |
|---|
| | 201 | ($decimalNumber mod 16) + 1, 1)" /> |
|---|