Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XHTML changing

From: "Joe Fawcett" <joefawcett@---------.------>
To: NULL
Date: 9/2/2007 9:02:00 AM

"Philipp Kraus" <philipp.kraus@f...> wrote in message 
news:fbcqu3$3bl$1@o......
> Hello,
>
> at the first time, many many thanks.
>
> On 2007-09-01 10:16:35 +0200, "Joe Fawcett" <joefawcett@n...> 
> said:
>
>> Two things:
>> 1) If your file is XHTML then you'll need to include the XHTML namespace 
>> declaration and your XPath should include the associated prefix: 
>> xhtml:html/xhtml:body/... etc.
>
> Need I use the namespace? Because my XHTML document must only copy a node 
> with subnodes, or must clear the node with their subnodes.
>
>> 2) If you just intend to copy all but a specific part then the standard 
>> practice is to use the identity transform with template overrides for 
>> elements that you don't need. For example to copy all but div elements 
>> with a class attribute of hide and their children then use:
>
> I have create this 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="node()|@*">
>        <xsl:copy>
>            <xsl:apply-templates select="node()|@*"/>
>        </xsl:copy>
>    </xsl:template>
>
>    <xsl:template match="div[@id='hauptnavi']"/>
>
> </xsl:stylesheet>
>
> But it is a full copy of my XHTML. The node (div) with attribute (id) and 
> the value "hauptnavi" will always copy.  The path to the div is: 
> /default:html/default:body[1]/default:div[1]/default:div[3]/default:div[3]
>
> 1
> -> aussen
> 2 -> page
> 3 -> hauptnavi
>
> Can u help me please again?
>
> Thanks
>
> Phil
>
Phil

That's because you need to match the namespace, so declare the namespace 
mapping in the stylsheet element and change the template to:
<xsl:template match="xhtml:div[@id='hauptnavi']"/>
If this still doesn't work post a small sample of the source and an example 
of your desired output.

-- 

Joe Fawcett (MVP - XML)
http://joe.fawcett.name





transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent