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
0
votes
1 answer

"This element is not expected" while using 'any' with xhtml namespace

I have some issues with XML Schema. I need to put some HTML code in my XML file and I found that xs:any would help. But xmllint return me errors like this: example.xml:4: element h1: Schemas validity error : Element 'h1': This element is not…
Paweł Golonko
  • 330
  • 2
  • 7
0
votes
1 answer

xmllint xsd:selector xpath behaviour different from --xpath or --shell

The command: xmllint myfile.xml --xpath 'MapField2Data[@country="FR"]/*[@active!="false" or not(@active) ]' works as expected for my xml structure But trying to use it in an xsd, it fails to compile: xmllint --loaddtd --noout --noent --xinclude…
Emmanuel Courreges
  • 708
  • 2
  • 6
  • 13
0
votes
1 answer

print an xml element only if an unrelated element is value

I have a bunch of Yandex.XML files with search results. http://api.yandex.com/xml/doc/dg/concepts/response.xml I want to find out the queries (//yandexsearch/request/query) for all such XML files where the first URL…
cnst
  • 25,870
  • 6
  • 90
  • 122
0
votes
1 answer

xmlint how to validade an invalide xml file using DTD external

I try to find way to parse xml file using xmllint libxml2 with an external dtd file. It's works with this : xmllint --dtdvalid radar.dtd radar.xml --output radargood.xml But this command doesn't do what i want. --ouput is the result of parsing, i…
0
votes
2 answers

xmllint does not work properly with xpath

Here is what I have. It clearly doesn't do what it supposed to and it even crashed. Is something wrong or is there any other tool that can help me parse XML in BASH? :~$ cat test.xml
user219882
  • 15,274
  • 23
  • 93
  • 138
0
votes
1 answer

parse xml using xmllint

I have an xml file as shown below. I want to use xmllint to parse it such that if the category is "SciFi", it will display the "isbn" number. After struggling a bit I could figure out how to print only the category or only the isbn number ; but…
souser
  • 5,868
  • 5
  • 35
  • 50
0
votes
1 answer

Why is this an XPath invalid query expression with Xmllint yet valid with Saxon?

I'm trying to learn XPath query using command line tools in Linux (I'm taking Stanford's Class2Go course Introduction to Databases). Given an XML file called BookstoreQ.xml of a Bookstore that contains both Books and Magazines, I can run the…
Alex
  • 1,470
  • 1
  • 11
  • 28
0
votes
1 answer

Can you run xmllint within eclipse to validate xml and dtd files?

Is it possible to run xmllint inside Eclipse or Motodev? If so can someone show me? I would like to validate my DTD and XML files. Thanks.
sebastian.c
  • 153
  • 1
  • 9
0
votes
1 answer

Is there any external tool in php/java to generateChangelog files for all database object?

I am trying to add the liquibase tool into my development environment to manage database migrations. Given the feature set it looks very flexible and promising. My first obvious question is how I can export all the existing schema into individual…
sakhunzai
  • 13,900
  • 23
  • 98
  • 159
0
votes
2 answers

xmllint validation succeeds on invalid input

Why does xmllint not report validation failure for the following xsd and xml ? t.xsd
user511274
  • 503
  • 4
  • 8
-1
votes
1 answer

Extract value only of an XML field using xmllint

I'm trying to extract the value of a specific field in an XML file and got as far as: xmllint --xpath '//component[@name="target_component"]/@team' my_file.xml Which will return, say: team="team_abc" Is there a way to get the actual value, ie…
Will1v
  • 143
  • 2
  • 11
-1
votes
1 answer

Rosetta url get the url based on the build id

i have XML file and i am trying to get the URL ends with RosettaUpdateAuto.pkg compared with BuildVersion if equals and fetch the url for the RosettaUpdateAuto.pkg. BuildVersion 20A5374g is equals and get the URL :…
manikandan
  • 11
  • 1
-1
votes
1 answer

Get the resources under a specific div (wget, xmllint, etc)

I already managed to get a section of the website I wanted. But, without the resources (audio). wget -q -O - "https://dictionary.cambridge.org/dictionary/english/admirable" | xmllint --html --xpath '//div[@class = "pos-header dpos-h"]' - 2>/dev/null…
BuddhiLW
  • 608
  • 3
  • 9
-1
votes
1 answer

Replace anything inside a HTML tag ID

Have searched all over Stackoverflow and Google, and the closest answer: sed -i -e 's|\([0-9]\{0,\}\)|'"$(date -d @${contents})"'|g' /var/www/html/index.html works only when the…
-1
votes
2 answers

How to get attribute value and element value from XML with xmllint

Have such a XML file.
Bomber
  • 13
  • 1
1 2 3
22
23