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

Re: Re: xsl fails to select html node

Subject: Re: Re: xsl fails to select html node
From: fe.sola@xxxxxxxxxxxxxx
Date: Wed, 27 Aug 2003 02:08:21 -0400
xsl select html
Thank you, that article was really handy, but I'm still facing some troubles...
I put this on the stylesheet, including the namespace of the xhtml file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ex="http://www.w3.org/1999/xhtml">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:template match="/">
		<Root>
		    <xsl:apply-templates select="ex:html"/>
		</Root>
	</xsl:template>
	<xsl:template match="ex:html">
	      <xsl:apply-templates select="ex:head"/>
		<xsl:apply-templates select="ex:body"/>
       </xsl:template>
	<xsl:template match="ex:head"/>
	<xsl:template match="ex:body">
but then for matching every single node of my input xml file I should add the prefix to 
the node name...so I'm wondering if I better delete the xmlns attribute from the input 
file.
My input file lookes like this:
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta content="HTML Tidy for Windows (vers 1st February 2003), see 
www.w3.org" name="generator"/>
		<title>My tittle</title>
	</head>
	<body> some elements here
        </body>
</html>

Is there no other way that adding prefixes to match nodes?
tia, 
lizet
Mensaje citado por Dimitre Novatchev <dnovatchev@xxxxxxxxx>:

> This is really a FFAQ. For an explanation see e.g.:
> 
> "None of my XPath select statements will work going against an XML file with
> a default namespace. Help! "
> 
> at: http://www.topxml.com/people/bosley/defaultns.asp
> 
> 
> =====
> Cheers,
> 
> Dimitre Novatchev.
> http://fxsl.sourceforge.net/ -- the home of FXSL
> 
> 
> 
> <fe.sola@xxxxxxxxxxxxxx> wrote in message
> news:1061933896.3f4bd348c3510@xxxxxxxxxxxxxxxxx
> >
> > Hello list:
> > This is probably a basic question. I'm applying an xsl transformation to
> xhtml files,
> > the template:
> > <xsl:template match="html">
> >       <xsl:apply-templates select="head"/>
> >       <xsl:apply-templates select="body"/>
> > </xsl:template>
> > fails to select the <html> node when it has namespaces attributes. The
> exact case is:
> > <html xmlns="http://www.w3.org/1999/xhtml">
> > Why is this happening? How can I solve it?
> > tia,
> > Lizet
> >
> >
> >
> > -------------------------------------------------
> > Este mensaje fue enviado usando el servicio de correo en web de Infomed
> > http://webmail.sld.cu
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >
> 
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 




-------------------------------------------------
Este mensaje fue enviado usando el servicio de correo en web de Infomed
http://webmail.sld.cu

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