Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    I suggest to check the XML against a Schema definition, see stackoverflow.com/a/129401/10622916 for available tools and stackoverflow.com/q/28987004/10622916 for a schema that checks for an empty value. Commented Sep 11, 2020 at 9:11
  • 1
    Assuming consistency in the input, a missing value appears always to be short-form (not requiring a separate </VALUE>. So a RE of <VALUE[^>]*/> matches an empty value. A script that silently greps for that and returns zero status (to mean at least one missing value) is a one-liner. Commented Sep 11, 2020 at 9:18
  • I don't do git. You mentioned a "git hook" so I assumed you knew how to glue my snippet in place. I would assume git commit would pass you the names so you could iterate over them in a script, or pass you the content so you could read it through a pipe, and you could return an exit code that would abort the commit. Or you just run the snippet manually first, for each file you want to commit. Commented Sep 12, 2020 at 9:16