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

Re: Transforming XHTML to XHTML using XSLT

Subject: Re: Transforming XHTML to XHTML using XSLT
From: Mike Brown <mike@xxxxxxxx>
Date: Sun, 31 Mar 2002 12:54:05 -0700 (MST)
transforming xhtml to xhtml
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

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-2007 All Rights Reserved.