|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Transforming XHTML to XHTML using XSLT
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






