User:RailML Coord Common/Tools

From railML 2 Wiki
< User:RailML Coord Common
Revision as of 02:37, 3 July 2021 by RailML Coord Common (talk | contribs) (created page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Check indentation: awk "BEGINFILE {indent=0} /^ *<\/[^>]+>$/ {indent=indent-2} /^ / { here=match($0, /</)-1 ; if (indent != here) print FILENAME, \":\", FNR, \":\", $0} /^ *<[^/!][^>]*[^/]>$/ { indent=here+2 }" *.xsd

Xpath for empty nodes: //*[text() and not(normalize-space()) and not(*)]