Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
L
libxml2
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 69
    • Issues 69
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • libxml2
  • Issues
  • #180

Closed
Open
Opened Aug 25, 2020 by Kevin Locke@kevinoid

xmllint: option to allow empty xpath set

Currently xmllint prints an error and exits with code 10 if the nodeset produced by the XPath expression is empty:

echo '<a/>' | xmllint --xpath /b -
XPath set is empty

This makes error handling difficult in shell scripts (since code 10 is not unique to empty set, and capturing stdout and stderr separately in portable POSIX shell is problematic).

Would you be willing to consider an option to treat empty nodesets as expected (i.e. empty output and exit code 0)? Perhaps --xpath-allow-empty or similar?

Thanks for considering, Kevin

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/libxml2#180