Subject: Re: [xsl] Transforming XHTML to XHTML using XSLT From: Mike Brown <mike@xxxxxxxx> Date: Sun, 31 Mar 2002 12:54:05 -0700 (MST) |
Joerg Heinicke wrote: > The only problem a beginner can have with your file is the namespace, you > set your XHTML-elements in: <html xmlns="http://www.w3.org/1999/xhtml">. > This means, every element which is a descendant of html (without a > namespace-prefix and setting a new namespace) and html itself are in this > XHTML namespace. This must be known in the XSLT too and you have to set the > same namespace. > > The simplest stylesheet for extracting title and paragraphs: > > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns="http://www.w3.org/1999/xhtml"> > > <xsl:output method="text"/> > > <xsl:template match="title"> This isn't going to work; this will match 'title' elements that are in the empty namespace. The default namespace that you set in the xsl:stylesheet element is only going to affect literal result elements, of which your stylesheet has none. The match patterns will not be affected. Anand needs to do this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml"> ... <xsl:template match="xhtml:title"> - Mike ____________________________________________________________________________ mike j. brown | xml/xslt: http://skew.org/xml/ denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Transforming XHTML to XHT, Joerg Heinicke | Thread | [xsl] Zero padding numbers in text , Garvin Franco |
Re: [xsl] Using value-of to extract, Mike Brown | Date | [xsl] xsl value-of, Matias Woloski |
Month |