diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-21 01:04:30 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-21 01:18:37 +0200 |
| commit | 80865b5a54d1d9b5ab2bf87747826cb87a219464 (patch) | |
| tree | 87e1fa36c02d8afc1218f269275753bb4295206b | |
| parent | 9ea9fc93d5c533732d6c003ba823c4baeabd871a (diff) | |
Better error locations in XML.cpl-metadata
| -rw-r--r-- | src/verify.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/verify.cc b/src/verify.cc index 0b48ce24..3301ca17 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -103,6 +103,8 @@ public: : _message (xml_ch_to_string(e.getMessage())) , _line (e.getLineNumber()) , _column (e.getColumnNumber()) + , _public_id (e.getPublicId() ? xml_ch_to_string(e.getPublicId()) : "") + , _system_id (e.getSystemId() ? xml_ch_to_string(e.getSystemId()) : "") { } @@ -119,10 +121,20 @@ public: return _column; } + string public_id () const { + return _public_id; + } + + string system_id () const { + return _system_id; + } + private: string _message; uint64_t _line; uint64_t _column; + string _public_id; + string _system_id; }; @@ -333,7 +345,7 @@ validate_xml (T xml, boost::filesystem::path xsd_dtd_directory, list<Verificatio VerificationNote::VERIFY_ERROR, VerificationNote::XML_VALIDATION_ERROR, i.message(), - xml, + boost::trim_copy(i.public_id() + " " + i.system_id()), i.line() ) ); |
