[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: Mike Brown <mike@xxxxxxxx>
Date: Tue, 4 Jun 2002 12:41:40 -0600 (MDT)
Re:  Processing HTML document.
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


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.