Re: Postgresql 8.4, XPath and name() function

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql 8.4, XPath and name() function
Date: 2010-07-14 16:06:04
Message-ID: m3oceagiab.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> wrote:

> [...]
>>> I would like to get "unit", but I just get an empty array ({}).
>>> How can I get "unit" ?

>> AFAIK, this is not related to PostgreSQL, but inherent to
>> XPath in that it returns elements from the document that
>> fulfill the XPath expression *unchanged*.

> My (poor) understanding is that XPath can be used as an
> expression language and as a selector specifier language.
> You can observe this in XSLT, where

> <xsl:template match="some-xpath"/>

> uses XPath as a selector of elements, and:

> <xsl:value-of select="some-xpath"/>

> uses XPath as an expression language, returning the output
> of a given XPath expression or function not just the
> "matched"/"not matched" status.

> I found this very confusing myself when learning XSLT, and
> it's possible I'm still misunderstanding it somewhat, but
> it's clear that XPath can be used in more than one way.
> [...]

Okay, that's maybe due to my XML socialization: An XPath ex-
pression to me has always been something you use in
"xsl:template" and "xmllint --shell", as in "xsl:value-of" &
Co. you have also access to other functions. It's even in
the specification :-):

| [...] The primary purpose
| of XPath is to address parts of an XML [XML] document. [...]

(from: <URI:http://www.w3.org/TR/xpath/>)

Tim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Kerr 2010-07-14 16:13:43 constraint/rule/trigger - insert into table X where not in table Y
Previous Message hubert depesz lubaczewski 2010-07-14 14:18:39 Re: Idle In Transaction