Forrest logo
back to context overview

xmllint

List of commands for xmllint:

  • xmllint:tldr:43c25 xmllint: Return human-readable (indented) XML from file.
    $ xmllint --format ${source_file-xml}
    try on your machine
    explain this command
  • xmllint:tldr:4a91c xmllint: Return the contents of the first node named "foo" as a string.
    $ xmllint --xpath "string(//${foo})" ${source_file-xml}
    try on your machine
    explain this command
  • xmllint:tldr:7ac8f xmllint: Validate XML against DTD schema hosted online.
    $ xmllint --dtdvalid ${URL} ${source_file-xml}
    try on your machine
    explain this command
  • xmllint:tldr:8ffbc xmllint: Return the href attribute of the second anchor element in an HTML file.
    $ xmllint --html --xpath "string(//a[2]/@href)" webpage.xhtml
    try on your machine
    explain this command
  • xmllint:tldr:a7cb7 xmllint: Return all nodes (tags) named "foo".
    $ xmllint --xpath "//${foo}" ${source_file-xml}
    try on your machine
    explain this command
  • xmllint:tldr:ac6c8 xmllint: Check that an XML file meets the requirements of its DOCTYPE declaration.
    $ xmllint --valid ${source_file-xml}
    try on your machine
    explain this command
back to context overview