T
Tjerk Wolterink
Hello i have xml code like this:
<page
age xmlns
age="namespacefor page">
<page:section>
<page:header>
<b>Hello</b>There
</page:header>
<page:content>
--- HTML CODE like:
<i>Y</i>es i like bla bal <center>bla</center><img> alblalba
</page:content>
</page:section>
</page
age>
Now i want to convert this page
age xml page to a xhtml page,
but i want all the xhtml tags like <b> to stay intact, how can i select
these tags to becopied in the xsl.
My xsl looks now like this:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns
age="http://www.wolterinkwebdesign.com/xml/page"
xmlns:menu="http://www.wolterinkwebdesign.com/xml/menu">
[cut]
<!--
! Matches a text section.
! Converts the page block to a html styled section of text
!-->
<xsl:template match="page:section">
<h1><xsl:value-of select="page:header"/></h1>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<!--
! Matches the content element in a section element
!-->
<xsl:template match="page:content">
<xsl:apply-templates/>
</xsl:template>
<!--
! Matches all xhtml tags and copies them
!-->
<xsl:template match=".[namespace-uri('')!=page]">
<xsl:copy-of select="."/>
</xsl:template>
[cut]
</xsl:stylesheet>
Well i tried to copy all elemetns who are not in the page namespace but
this xpath expression: .[namespace-uri('')!=page] does not work.
How should i copy all xhtml tags??
The output should be like this:
<html>
<h1>
<b>Hello</b>There
</h1>
<div><p>
--- HTML CODE like:
<i>Y</i>es i like bla bal <center>bla</center><img> alblalba
</p></div>
</html>
Pleaz help me
<page
<page:section>
<page:header>
<b>Hello</b>There
</page:header>
<page:content>
--- HTML CODE like:
<i>Y</i>es i like bla bal <center>bla</center><img> alblalba
</page:content>
</page:section>
</page
Now i want to convert this page
but i want all the xhtml tags like <b> to stay intact, how can i select
these tags to becopied in the xsl.
My xsl looks now like this:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns
xmlns:menu="http://www.wolterinkwebdesign.com/xml/menu">
[cut]
<!--
! Matches a text section.
! Converts the page block to a html styled section of text
!-->
<xsl:template match="page:section">
<h1><xsl:value-of select="page:header"/></h1>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<!--
! Matches the content element in a section element
!-->
<xsl:template match="page:content">
<xsl:apply-templates/>
</xsl:template>
<!--
! Matches all xhtml tags and copies them
!-->
<xsl:template match=".[namespace-uri('')!=page]">
<xsl:copy-of select="."/>
</xsl:template>
[cut]
</xsl:stylesheet>
Well i tried to copy all elemetns who are not in the page namespace but
this xpath expression: .[namespace-uri('')!=page] does not work.
How should i copy all xhtml tags??
The output should be like this:
<html>
<h1>
<b>Hello</b>There
</h1>
<div><p>
--- HTML CODE like:
<i>Y</i>es i like bla bal <center>bla</center><img> alblalba
</p></div>
</html>
Pleaz help me