Bug#551182: xpath expressions fail to properly deal with some namespace variants

Andrea Veri andrea.veri89 at gmail.com
Fri Oct 16 12:59:26 BST 2009


Package: mozilla-devscripts
Version: 0.17

Hi,

while migrating fission package to mozilla-devscripts I noticed that
m-ds was unable to parse the install.rdf properly.

Attaching the relative discussion we had on IRC so that might help as
reminder:

 TARGET_VERSION = $(shell xpath -q -e
'//em:targetApplication/Description[em:id="$(1)" or
@em:id="$(1)"]/em:$(2)/text()
| //em:targetApplication/Description[em:id="$(1)" or
@em:id="$(1)"]/@em:$(2)
| //RDF:Description[@em:id="$(1)"]/em:$(2)/text()
| //RDF:Description[@em:id="$(1)"]/@em:$(2)' $(3)/install.rdf | sed -e
's/.*"\(.*\)"/\1/')

TARGET_VERSION = $(shell xpath -q -e
'//local-name("targetApplication")/local-name("Description")[em:id="$(1)"
or @em:id="$(1)"]/em:$(2)/text()  ...
 TARGET_VERSION =$(shell xpath -q
-e
'//local-name("targetApplication")/local-name("Description")[em:id="$(1)"
or @em:id="$(1)"]/em:$(2)/text()  ...

<asac>  //node()[local-name(.) = 'targetApplication']
<asac> so for each occurance of: "em:targetApplication" ... make
node()[local-name(.) = 'targetApplication'] <asac> and for each
occurence of Description make <asac> node()[local-name(.) =
'Description']
<asac> xpath -q -e "//node()[local-name(.) =
'targetApplication']/node()[local-name(.) = 'Description']"
unpack/install.rdf  2>/dev/null

Forwarding this bug to Ubuntu as well.





More information about the Ubuntu-mozillateam mailing list