Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Processing HTML document.

From: Mike Brown <mike@-------->
To:
Date: 6/4/2002 10:51:00 AM
Antonio Fiol wrote:
> 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 (!)

Yes, it does, but only because XPath expressions are designed to be so 
convenient for working with elements that are in no namespace. Once you 
introduce namespaces, they become more complex (yet in a way, they're still 
very simple...)

The XPath expression

  foo/bar/baz

means

  child::foo/child::bar/child::baz.

In practice, child::foo is essentially equivalent to:

  child::*[namespace-uri()='' and local-name()='foo']

It is not, as you might hope, equivalent to child::*[name()='foo'].

If you have x:foo instead of foo, by definition it means 'element "foo" in the 
namespace URI that is bound to the "x" prefix'. If that URI is 
"http://some/unique/URI", then child::x:foo essentially means:

  child::*[namespace-uri()='http://some/unique/URI' and local-name()='foo']

I hope this helps.

   - 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


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