Skip to content

Commit

Permalink
feat: lint xsd files (#5250)
Browse files Browse the repository at this point in the history
Lint XSD files with xmllint

Close #5248
  • Loading branch information
ferrarimarco committed Feb 9, 2024
1 parent fe6e29b commit a26db6d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/functions/buildFileList.sh
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ BuildFileArrays() {
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-TSX"
elif [ "${FILE_TYPE}" == "txt" ]; then
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-TXT"
elif [ "${FILE_TYPE}" == "xml" ]; then
elif [ "${FILE_TYPE}" == "xml" ] ||
[ "${FILE_TYPE}" == "xsd" ]; then
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-XML"
elif [ "${FILE_TYPE}" == "yml" ] || [ "${FILE_TYPE}" == "yaml" ]; then
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-YAML"
Expand Down
7 changes: 7 additions & 0 deletions test/linters/xml/xsd_bad_1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<!-- $Header: /cvsroot/ebxmlrr/ebxmlrr-spec/misc/3.0/schema/rim.xsd,v 1.20 2005/02/03 19:28:15 farrukh_najmi Exp $ -->
<schema targetNamespace="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"
xmlns:xml="http://www.w3.org/XML/1998/names=
<maxLength value="4"/>
6 changes: 6 additions & 0 deletions test/linters/xml/xsd_good_1.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<!-- $Header: /cvsroot/ebxmlrr/ebxmlrr-spec/misc/3.0/schema/rim.xsd,v 1.20 2005/02/03 19:28:15 farrukh_najmi Exp $ -->
<schema targetNamespace="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"
xmlns:xml="http://www.w3.org/XML/1998/namespace" />

0 comments on commit a26db6d

Please sign in to comment.