Bug 837204 - %pom_xpath_remove does not work with simple queries
%pom_xpath_remove does not work with simple queries
Product: Fedora
Classification: Fedora
Component: javapackages-tools (Show other bugs)
All Linux
high Severity high
: ---
: ---
Assigned To: Mikolaj Izdebski
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-07-03 03:17 EDT by Krzysztof Daniel
Modified: 2014-01-12 19:27 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-07-09 05:10:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Krzysztof Daniel 2012-07-03 03:17:52 EDT
pom files use a default namespace. XPath does not work well with default namespaces, and simple queries like


do not work at all. it is necessary to use functions which are complicated and unreadable
%pom_xpath_remove "*[local-name() = 'environment' and namespace-uri() = 'http://maven.apache.org/POM/4.0.0']/*[local-name() = 'os' and not(text() = 'linux')]
Comment 1 Mikolaj Izdebski 2012-07-09 05:10:50 EDT
Implicit POM namespace can't be easily implemented because of XPath limitations.
POM namespace has to be specified explicitly for every node.

The expression from comment #1 could be written as:
%pom_xpath_remove "pom:environment/pom:os[not(text() = 'linux')]"
(or similar) which is much better, but yet not perfect. As far as I know
the pom: prefix can't be easily eliminated from XPath expressions.

To clarify this, the following comment was added upstream:

# NOTE: POM files use a specific namespace - http://maven.apache.org/POM/4.0.0.
# The easiest way to respect this namespace in XPath expressions is prefixing
# all node names with "pom:". For example, "pom:environment/pom:os" will work
# because it selects nodes from pom namespace, but "environment/os" won't find
# anything because it looks for nodes that don't belong to any XML namespace.
Comment 2 Fedora Update System 2012-07-09 10:40:46 EDT
jpackage-utils-1.7.5-18.1.fc17 has been submitted as an update for Fedora 17.
Comment 3 Fedora Update System 2012-07-23 16:27:49 EDT
jpackage-utils-1.7.5-18.1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.