<it> находится внутри <title>, поэтому мы не можем использовать "value-of" - PullRequest
0 голосов
/ 29 апреля 2020
   <section>
    <title>WHO applauds the efforts of test developers to <it>innovate and respond</it> to the needs of the population</title>

<xsl:template match="section/title">
    <xsl:element name="head1">
        <xsl:apply-templates select="upper-case(node())"/>
    </xsl:element>
</xsl:template>

1 Ответ

0 голосов
/ 29 апреля 2020

Используйте

<xsl:template match="section/title//text()">
   <xsl:value-of select="upper-case(.)"/>
</xsl:template>

вместе с преобразованием идентичности (например, объявлено <xsl:mode on-no-match="shallow-copy"/> в XSLT 3 или записано как

<xsl:template match="@* | node()">
   <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
   </xsl:copy>
</xsl:template>

в более ранних версиях).

Затем вы можете переопределить его для любых других преобразований, которые вы хотите или нуждаетесь, добавив определенные c шаблоны, например <xsl:template match="section/title"><head1><xsl:apply-templates/></head1></xsl:template>.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...