This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]