Questions tagged [xmllint]

xmllint is a command line XML parser which provides syntax validation, gzip compression, and formatting options.

xmllint is a command line tool that is part of libxml2 which is a C Parser and toolkit that runs on multiple platforms. Download links for libxml2 can be found at http://xmlsoft.org/downloads.html

344 questions
7
votes
2 answers

get attribute value using xmlstarlet or xmllint

I have gone through several of questions since last two days but yet to find a solution. Here is my xml:
Pramod
  • 768
  • 1
  • 12
  • 27
6
votes
0 answers

Parse HTML5 with xmllint invalid tag

I'm trying to parse html5 with xmllint, and it's generating errors on certain tags. To make sure it's valid I piped the output through tidy first, but it generated the same errors. I only want to extract the text. Is there any way to read these…
Matts
  • 1,301
  • 11
  • 30
6
votes
2 answers

how can you use xmllint to validate against an internally specified xsd?

I know you can use the xmllint command to validate against local xsd files, or against xsd network file locations, but what I'd like to do is instruct xmllint to validate an XML file against its "internally specified" xsd, for instance this XML…
rogerdpack
  • 62,887
  • 36
  • 269
  • 388
6
votes
4 answers

Pulling out the version in the pom.xml

I want to append the Jenkins build number in my pom.xml file. I can do this via the Maven Version plugin, but first I need the original version from the pom.xml file. In order to do this, I am using the command xmllint --xpath…
David W.
  • 105,218
  • 39
  • 216
  • 337
6
votes
4 answers

xmllint: how to convert UTF-8 numeric references into characters

I'd like to convert UTF-8 numeric references into characters in the output from xmllint. To reproduce: $ wget http://il.srgssr.ch/integrationlayer/1.0/ue/rts/video/play/4727630.xml $ xmllint --xpath "/Video/AssetMetadatas/AssetMetadata/title/text()"…
raphaelh
  • 735
  • 6
  • 8
6
votes
2 answers

Inconsistent XSD validation of nested elements using ``

I'm working on a tool to help a user author XHTML-ish documents which are similar in nature to JSP files. The documents are XML and can contain any well-formed tags in the XHTML namespace, and weaved between them are elements from my product's…
Richard JP Le Guen
  • 28,364
  • 7
  • 89
  • 119
6
votes
2 answers

xmllint: xmlns on a non-root xml element?

xmllint --xpath "//project" test.xml fails on 4.0.0 but succeeds if I remove the…
user2684301
  • 2,550
  • 1
  • 24
  • 33
6
votes
1 answer

xmllint DTD validation syntax

Trying to validate an XML document; however, xmllint is insisting on reading the options as the file so I'm getting FileNotFound exceptions. Just to confirm, I have the xmllint.exe in the same folder as my XML file. I locate the directory in CMD and…
JohnW
  • 345
  • 1
  • 7
  • 15
6
votes
1 answer

What's the output format of xmllint ls?

Using xmllint --shell, I execute chapter > cat * ------- Getting to Know Penguins ------- Penguins are cute. ------- The Head ...
Rose Perrone
  • 61,572
  • 58
  • 208
  • 243
5
votes
1 answer

xmllint returns XPath set is empty

What I do wrong? I get XPath set is empty when run the following command. xmllint --xpath './/PackageReference[@Include="Tips"]/Version/text()' sdk/Test/TestSample.xml Please find below the xml file content.
valyman
  • 53
  • 1
  • 3
5
votes
0 answers

XInclude using urn with multiple colons

Based off of How to use xpointer with Xinclude to reference elements ... I am having issues including a nested element using xpointer when the namespace urn contains multiple colons. Test1.xml
JRomero
  • 4,878
  • 1
  • 27
  • 49
5
votes
0 answers

xmllint not parsing attributes with --stream

I'm using xmllint on OS X to try to validate an XML file against an XSD. The sample XML is: 2011-08-01 15.23
mezza
  • 63
  • 5
5
votes
2 answers

Need XPath ends-with function

I am having trouble getting an XPath function to work. I am supposed to pull only the entries in the XML file that the name of them ends with the letter 'z' and I cannot get it to work. I am xmllint to manipulate the file with the cat…
BMitrano825
  • 123
  • 1
  • 10
5
votes
3 answers

Get Node value from a XML using xmllint

I have a xml called Det.xml like this :
The Dark Knight
  • 5,455
  • 11
  • 54
  • 95
5
votes
2 answers

linux xmllint schema validation fails but error code 0

Command line xmllint --schema validation fails but $? returns 0 myinput.xml:
mytestvalue
myschema.xsd
user1549605
  • 273
  • 3
  • 17
1 2
3
22 23