Re: using HTML tags in XML documents

[email protected] 14 Mar 2007 10:48:45 -0700
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Organization http://groups.google.com
Message-ID <[email protected]>
Thanks =)
But, this doesn't seem to work with my stylesheet, only when I use a
clean one. :X
I've looked over it several times, but I can't seem to find the cause :
\
Any chance you could help me figure it out?
The current version is again at http://l2f.noodley.com/xml/

Thanks again! :)

Martin Honnen wrote:
> [email protected] wrote:
> > I would like to be able to use tags like <html:br/> in my XML document
> > (http://l2f.noodley.com/xml/index.xml, they are commented out).
> >
> > I want a tag like the above to be the HTML equivalent of <br/> without
> > having to create a template for each and every tag. Is this possible?
>
> You can use XHTML element e.g.
>
>    <page xmlns:xhtml="http://www.w3.org/1999/xhtml">
>      <news>
>        <item>
>           ...
>           <xhtml:br/>
>        </item>
>      </news>
>    </page>
>
> then you need a template to copy XHTML through (if the output is XML) or
> to convert them to HTML (if the output is HTML):
>
>    <xsl:template match="item">
>      <li><xsl:apply-templates/></li>
>    </xsl:template>
>    <xsl:template xmlns:xhtml="http://www.w3.org/1999/xhtml"
>       match="xhtml:*">
>        <xsl:copy>
>          <xsl:apply-templates select="@* | node()"/>
>        </xsl:copy>
>    </xsl:template>
> respectively
>    <xsl:template xmlns:xhtml="http://www.w3.org/1999/xhtml"
>       match="xhtml:*">
>        <xsl:element name="{local-name()}">
>          <xsl:apply-templates select="@* | node()"/>
>        </xsl:element>
>    </xsl:template>
>
> --
>
> 	Martin Honnen
> 	http://JavaScript.FAQTs.com/