Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Processing HTML document.

From: Antonio Fiol <fiol@---------->
To:
Date: 6/4/2002 9:59:00 AM
Oleg Tkachenko wrote:



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. 




I tried that just _before_ reading your e-mail. It worked.



However, it should be possible to use the raw "html/body/table...", 
shouldn't it?



When I have an XML input (home made XML, using default namespace, just 
like the HTML file I'm inputting), I simply name the tags I want, and it 
works just fine (!)




Antonio Fiol



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&iacute;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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent