[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

remove shape="rect" attribute from anchors within xsl

Subject: remove shape="rect" attribute from anchors within xsl:template
From: "B. Kamer" <post@xxxxxxxxxxx>
Date: Fri, 2 Nov 2007 14:02:11 +0100
 remove shape="rect" attribute from anchors within  xsl
hi all,

i am totally new to xslt so forgive my for asking stupid things.

let me explain my goals:

- i have several xhtml documents
- these documents are listed in an xml document
- the xsl template reads the xml and 'imports' the xhtml files (with <xsl:copy-of select="document($full-path)/html:html/html:body/*" namespace="http://www.w3.org/1999/xhtml"/>) to generate a new xhtml document.


Basicly it merges xhtml documents & adds a table of contents based on anchors in the documents... (i didn't write that myself)

this works, more or less, but several things are added into the output...

but <a> tags in the imported documents are getting an shape="rect" attribute that i don't like...

i found this document to remove those by setting a template for them

<xsl:template match="xhtml:a/@shape"/>

see: http://xmlplease.com/shaperect

but as my imported documents are not part of the xml file this does not work...

here is the template responsible of merging the documents

    <xsl:template name="merge-documents">
        <xsl:param name="chapter-list" />

        <xsl:variable name="result">
            <xsl:for-each select="$chapter-list">
                <xsl:variable name="full-path">
                    <xsl:value-of select="$base-path" />
                    <xsl:text>/</xsl:text>
                    <xsl:value-of select="@path" />
                </xsl:variable>

<xsl:copy-of select="document($full-path)/html:html/ html:body/*" namespace="http://www.w3.org/1999/xhtml"/>
</xsl:for-each>
</xsl:variable>


<!-- Return merged document -->
<xsl:copy-of select="$result" namespace="http://www.w3.org/1999/xhtml " />
</xsl:template>



Now, my question, how do i remove the unwanted attributes from any anchor tag in the $result variable?



thank you


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.