Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: XHTML changing >Thread Next - Re: XHTML changing Re: XHTML changingTo: 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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
