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

Re: Processing HTML document.

Subject: Re: Processing HTML document.
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Tue, 04 Jun 2002 20:41:26 +0200
x table xml
Declare xhtml namespace in the stylesheet and use something like "x:html/x:body/x:table...", where x is a defined by you xhtml namespace prefix.

Antonio Fiol wrote:
Hello,

I am trying to get an XHTML document into an XSLT processor, to get XML on the output.

For example, I want to be able to use the following on my XSL file:


<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" /> <xsl:template match="/"> <article> <xsl:apply-templates select="html/body/table[3]/tr[1]/td[1]" /> </article> </xsl:template> </xsl:stylesheet>

Because I know that on the first cell of the first row of the third table which is directly in the body of my html document contains an article.

It does not work. I am afraid I have a problem with my namespaces, as the following (equivalent) XSL works:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />
<xsl:template match="/">
<article>
<xsl:apply-templates select="*[name()='html']/*[name()='body']/*[name()='table'][3]/*[name()='tr'][1]/*[name()='td'][1]" />
</article>
</xsl:template>
</xsl:stylesheet>


However, I'd prefer not to use the second form. Obvious reason.


What am I doing wrong?????!!!



Antonio Fiol Bonnín



P.S.: Here is the beginning of my HTML code: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <!-- #BeginTemplate "/Templates/standard.dwt" -->

 <head>
    <!-- Some meta tags and a link tag. All of them empty and valid. -->
 </head>

 <body bgcolor="#FFFFFF" text="#000000">
[...]


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list





-- Oleg Tkachenko Multiconn International, Israel


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.