next segment of XSLT:
<xsl:template match="p|b|i">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
will actually generate output for example
(18221895)
But I want
(1822-1895)
I can not reproduce the problem.
With this XML document (fixed to be well-formed):
<!DOCTYPE p [
<!ENTITY ndash "–">
]>
<p>
<media id="pc300220-scpwr.gif" print-rights="no"
rights="licensed" type="photo">
<title>Louis Pasteur</title>
<credit>Granger Collection</credit>
</media>
<b>Louis</b>
<pronunciation>
<word-term>
<b>Pasteur</b>
</word-term>
</pronunciation> (1822–1895) was a French chemist. He made major contributions to chemistry, medicine, and industry. His work has greatly benefited people. For example, he discovered that diseases spread through
<definition>
<word-term>bacteria </word-term>
<word-definition>tiny living things</word-definition>
</definition>. This discovery has saved many millions of lives.
</p>
, and when this conversion is applied :
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="p|b|i">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
result :
Louis Pasteur
Granger Collection
<b>Louis</b>
<b>Pasteur</b>
(1822–1895) was a French chemist. He made major contributions to chemistry, medicine, and industry. His work has greatly benefited people. For example, he discovered that diseases spread through
bacteria
tiny living things
. This discovery has saved many millions of lives.
source
share