xpath expressions fail to properly deal with some namespace variants

Bug #453040 reported by Andrea Veri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mozilla-devscripts (Debian)
Fix Released
Unknown
mozilla-devscripts (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: mozilla-devscripts

Forwarding Debian Bug about xpath expressions fail to properly deal with some namespace variants.

IRC logs:

<asac> 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/')
<asac> TARGET_VERSION = $(shell xpath -q -e '//local-name("targetApplication")/local-name("Description")[em:id="$(1)" or @em:id="$(1)"]/em:$(2)/text()

<asac> so the right approach is:
<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

Revision history for this message
Alexander Sack (asac) wrote :

we should do the whole namespace business proper. full spec is http://www.w3.org/TR/xpath ... also xpath tool is buggy, so only some variants of doing this will work.

Changed in mozilla-devscripts (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in mozilla-devscripts (Debian):
status: Unknown → New
Benjamin Drung (bdrung)
Changed in mozilla-devscripts (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.5 KiB)

This bug was fixed in the package mozilla-devscripts - 0.19

---------------
mozilla-devscripts (0.19) unstable; urgency=low

  * xpi.mk:
    - get rid of temp directory; extract xpi file directly into installation
      directory
      - update src/xpi.mk
    - correct permissions of installed files and add
      MOZ_XPI_PRESERVE_PERMISSIONS to disable this behaviour (Closes: #556741)
      - update src/xpi.mk
    - drop support for deprecated MOZ_EXT_NAME and MOZ_XPI_MOZILLA_DIRS variable
      - update src/xpi.mk
    - add new MOZ_XPI_INSTALL_DIRECTORY variable
      - update src/xpi.mk
  * med-xpi-{pack,unpack}:
    - Drop med- prefix.
      - rename man/med-xpi-{pack,unpack}.1 to man/xpi-{pack,unpack}.1
      - rename src/med-xpi-{pack,unpack} to src/xpi-{pack,unpack}
      - update README
      - update src/Makefile
      - update src/xpi.mk
  * xpi-data:
    - Add Firefox 3.6 and Thunderbird 3.0 for lucid.
      - update src/xpi-data-Ubuntu.mk
    - Convert xpi-data-*.mk files into xul-app-data.csv* files for dh_xul-ext
      - remove src/xpi-config.mk.in
      - remove src/xpi-data-Debian.mk
      - remove src/xpi-data-Ubuntu.mk
      - remove src/xpi-data-all.mk
      - remove src/xpi-data-common.mk
      - add src/xul-app-data.csv.Debian
      - add src/xul-app-data.csv.Ubuntu
      - update src/Makefile
  * dh_xul-ext:
    - Split substvars calculation from xpi.mk into new dh_xul-ext.
      - add src/dh_xul-ext
      - update src/Makefile
      - update src/xpi.mk
    - Move compare_versions from moz-version into separate module moz_version.py
      - add src/moz_version.py
      - update src/moz-version
      - update src/dh_xul-ext
    - Install moz_version.py using python-support
      - update debian/control
      - update debian/rules
      - update src/Makefile
    - Add "xul-ext" dh sequence
      - add src/xul-ext.pm
      - update src/Makefile
      - update debian/control
    - wrote man page for dh_xul-ext
      - add man/dh_xul-ext.1
      - update src/Makefile
  * install-xpi:
    - Split xpi installation from xpi.mk into new install-xpi script.
      - add src/install-xpi
      - update src/Makefile
      - update src/xpi.mk
      - update debian/control
    - wrote man page for install-xpi
      - add man/install-xpi.1
      - update src/Makefile
    - add --install-dir parameter to install-xpi
      - update man/install-xpi.1
      - update src/install-xpi
    - create links for architecture independent extensions in /usr/share instead
      of /usr/lib (Closes: #564671)
      - update src/install-xpi
    - create additional symlinks for icedove and thunderbird, because they do
      not scan /usr/{lib,share}/mozilla/extensions/$target_application
      - update src/install-xpi
  * moz-version:
    - Add parameter for converting Mozilla versions into Debian upstream
      versions and the other way round.
      - update man/moz-version.1
      - update src/moz_version.py
      - update src/moz-version
    - Add a test suite for testing moz-version --compare
      - add tests/test-moz-version
      - update debian/rules
      - update src/Makefile
  * packaging:
    - add homepage field
      - update debian/control
...

Read more...

Changed in mozilla-devscripts (Ubuntu):
status: Fix Committed → Fix Released
Changed in mozilla-devscripts (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.