Craig Ringer <craig@xxxxxxxxxxxxxxxxxxxxx> 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general