fast-xml-validator 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/fxv.cjs +1 -1
- package/lib/fxv.min.js +1 -1
- package/lib/fxv.min.js.map +1 -1
- package/package.json +1 -1
- package/src/validator.js +9 -4
package/package.json
CHANGED
package/src/validator.js
CHANGED
|
@@ -387,10 +387,15 @@ function validateAttributeString(attrStr, options, xmlVersion) {
|
|
|
387
387
|
return { err: { code: 'InvalidAttr', msg: "Attribute '" + attrName + "' is an invalid name.", line: getPositionFromMatch(matches[i]) } };
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
// xmlns="" (undeclaring the
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
390
|
+
// xmlns="" (undeclaring the prefixed namespace) is valid in XML 1.1
|
|
391
|
+
if (attrName.startsWith('xmlns:') && matches[i][6] === '' && xmlVersion === '1.0') {
|
|
392
|
+
return {
|
|
393
|
+
err: {
|
|
394
|
+
code: 'InvalidAttr',
|
|
395
|
+
msg: `Undeclaring the prefixed namespace ${attrName}="" is only permitted in XML 1.1 documents.`,
|
|
396
|
+
line: getPositionFromMatch(matches[i])
|
|
397
|
+
}
|
|
398
|
+
};
|
|
394
399
|
}
|
|
395
400
|
|
|
396
401
|
if (!Object.prototype.hasOwnProperty.call(attrNames, attrName)) {
|