xsl-list
[Top] [All Lists]

[xsl] XSLT/XPATH 2.0 - except example.

2009-07-22 16:45:29
Using Saxon 9
Windows
XSLT/XPATH 2.0

Hi,

I'm trying to remove the h1 from my source with the "except" and it
doesn't work.
ex:<xsl:copy-of  select="* except
(//xhtml:div[(_at_)class='border']//xhtml:h1)" />

When I do the same logic to class=border section it work?? 
<xsl:copy-of  select="* except(//xhtml:div[(_at_)class='border'])" />   

What I'm I missing, with the except for the removal of that section
h1???
Note: source code included.
Regards,

Michel

---------------   My StyleSheet
<xsl:strip-space elements="*"/>
<xsl:template match="xhtml:html" exclude-result-prefixes="xhtml" >

<root>
                        <content>
                                <xsl:apply-templates
select="//xhtml:div[(_at_)class='center']"  exclude-result-prefixes="xhtml"/>

                        </content>
</root>
</xsl:template>
<!--
=======================================================================
-->
<!--*****************************************-->
<!-- Content section just remove the right nav-->
  <xsl:template match ="//xhtml:div[(_at_)class='center']"
exclude-result-prefixes="xhtml">
                <!-- Right Nav first-->
                Remove h1
            <!-- THIS doesn't WORK, why????? -->               
                        <xsl:copy-of  select="* except
(//xhtml:div[(_at_)class='border']//xhtml:h1)" />                               
            END of remove h1
            <!-- THIS WORK -->         
               <xsl:copy-of  select="*
except(//xhtml:div[(_at_)class='border'])" />   
  </xsl:template>
<!--*****************************************-->
</xsl:stylesheet>

---------------   My Source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">
<head>
</head>
<body>
<!--googleoff:all-->
<div class="page">
<div class="center">
<div class="border">
<h1>
<a name="cont" id="cont">
 Aviation Security </a>
 </h1>
<p>The Government of Canada has committed more than programs include the
following:</p>
</div>
</div>
</div>
</body>
</html>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>