diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-08 15:35:23 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-08 15:35:23 +0200 |
commit | 7db026e8056914d113ac0bbfd9bdc4908a9e7874 (patch) | |
tree | 0ab15cb8b0ee160a10cca21edaf0aca1e97e8921 /libxsde/xsde/cxx/parser/validating/nmtoken-stl.cxx | |
parent | 4f38adc11ab1a3a1ab2dd3f958c917182be7d71f (diff) |
Add support for the whiteSpace facet
Use the same mechanism to handle whitespace processing for build-in types
and enumerations.
Diffstat (limited to 'libxsde/xsde/cxx/parser/validating/nmtoken-stl.cxx')
-rw-r--r-- | libxsde/xsde/cxx/parser/validating/nmtoken-stl.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/libxsde/xsde/cxx/parser/validating/nmtoken-stl.cxx b/libxsde/xsde/cxx/parser/validating/nmtoken-stl.cxx index 62e867b..17ab6a0 100644 --- a/libxsde/xsde/cxx/parser/validating/nmtoken-stl.cxx +++ b/libxsde/xsde/cxx/parser/validating/nmtoken-stl.cxx @@ -39,8 +39,11 @@ namespace xsde void nmtoken_pimpl:: _post () { - ro_string tmp (str_); - ro_string::size_type size = trim_right (tmp); + if (!string_common::validate_facets (str_, _facets (), _context ())) + return; + + typedef std::string::size_type size_type; + size_type size = str_.size (); // For now we are only checking the US-ASCII characters. // @@ -49,7 +52,7 @@ namespace xsde if (ok) { - for (ro_string::size_type i = 0; i < size; ++i) + for (size_type i = 0; i < size; ++i) { unsigned char c = static_cast<unsigned char> (str_[i]); @@ -61,16 +64,8 @@ namespace xsde } } - str_.resize (size); - if (!ok) - { _schema_error (schema_error::invalid_nmtoken_value); - return; - } - - string_common::validate_facets ( - str_.c_str (), str_.size (), _facets (), _context ()); } std::string nmtoken_pimpl:: |