Search code examples
xmllint

xmllint: Remove <?xml version="1.0"?>


I am using xmllint to clean up my .xml file but for some reason the output adds <?xml version="1.0"?> to the first line. Is there a flag to have this be removed?


Solution

  • Both of the following seem to avoid insertion of <?xml version="1.0"?>:

    • xmllint --exc-c14n data.xml

    • xmllint --c14n data.xml

    Hint:

    xmllint --help

    -or-

    man xmllint