以下の xml ファイルについて言及しましたが、xml には多くの内部スタイル タグが含まれています (すべてのテキストを抽出するには、一般的な xslt コードを使用してください)。
<?xml version="1.0" encoding="UTF-8"?>
<Values>
<Value AttributeID="11218">
<Text>WGP03068-CNZH-00
<style name="bold">Introduction of the Title</style>xslt
<style name="TextStyle1">
The smallest font size for which kerning should be automatically adjusted.
</style>
<style name="bold">Reference for this book
<style name="TextStyle1">
The smallest font size for which kerning should be automatically adjusted.
</style>
Hope you had a good learning experience.
</style>
I am expecting more solution for my doughts.
</Text>
</Value>
</Values>
私のXSLTコードは以下に記載されています:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<HTML>
<xsl:apply-templates />
</HTML>
</xsl:template>
<xsl:template match="Values">
<xsl:for-each select="Value">
<xsl:for-each select="Text">
<p>
<xsl:for-each select="style">
<xsl:value-of select="." />
</xsl:for-each>
</p>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
私の XSLT には、要素の開始テキストと終了テキストがなく、要素のみを読み取ります。外側と内側のタグ テキストをすべて読み取り、独自のスタイル (太字、斜体、フォント名、色など) を追加したい
私は以下のような出力を期待しています:
WGP03068-CNZH-00 タイトルの紹介xslt カーニングが自動的に調整される最小のフォント サイズ。 本書の参考文献 カーニングを自動調整するフォントの最小サイズです。私は自分の考えに対するより多くの解決策を期待しています。