This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: !!!showing HTML data in XML files using XSL!!!
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] !!!showing HTML data in XML files using XSL!!!
- From: "Chris Bayes" <Chris at Bayes dot co dot uk>
- Date: Fri, 30 Mar 2001 08:36:33 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
Rosa,
I'm sure you are wrong. You don't have a template that matches either I or B
elements so when the "text" template does an apply-templates only the
default ones fire so all you will get it the text. If I try it with xsxml i
get
<html>
<body>
here is some info
</body>
</html>
You need the following template to get it to work
<xsl:template match="*|@*">
<xsl:copy>
<xsl:apply-templates select="@* | * | comment() | processing-instruction()
| text()"/>
</xsl:copy>
</xsl:template>
The one you have <xsl:template match="@*"> only matches attributes and you
don't have a single attribute in your xml
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
>-----Original Message-----
>From: owner-xsl-list@lists.mulberrytech.com
>[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Rosa I-Ting
>Cheng
>Sent: 30 March 2001 08:06
>To: 'xsl-list@lists.mulberrytech.com'
>Subject: [xsl] !!!showing HTML data in XML files using XSL!!!
>
>
>I did the XSL at the end, but what I'd get back if the xml is like this:
>
><root>
><text><I><B>here is some info</B></I></text>
></root>
>
>is this
>
><I><B>here is some info</B></I> instead of having the text italiced or
>bolded...
>
>XSL:
><?xml version="1.0" encoding="UTF-8"?>
><xsl:stylesheet version="1.0"
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
><xsl:template match="@*">
> <xsl:copy>
> <xsl:apply-templates
>select="@*"/>
> </xsl:copy>
></xsl:template>
>
><xsl:template match="root">
><html>
><body>
> <xsl:apply-templates />
></body>
></html>
></xsl:template>
><xsl:template match="text">
> <xsl:apply-templates />
></xsl:template>
></xsl:stylesheet>
>
>How can I fix that?
>
>
>Thanks in advance!
>
>
>Rosa
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list