File: Data.xml
<article>
<title author="bd" ver="1.0">My Article</title>
<p>First paragraph. 3 < 4.</p>
<p>Second paragraph. AT&T is a big company.</p>
</article>
File: Transform.xslt
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" />
<xsl:template match="article">
{\rtf1
<xsl:apply-templates />
}
</xsl:template>
<xsl:template match="title">
\par {\b
<xsl:apply-templates />
}
</xsl:template>
<xsl:template match="p">
\par
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
Output:
{\rtf1
\par {\b
My Article
}
\par
First paragraph. 3 < 4.
\par
Second paragraph. AT&T is a big company.
}
|