From 7db026e8056914d113ac0bbfd9bdc4908a9e7874 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Oct 2010 15:35:23 +0200 Subject: Add support for the whiteSpace facet Use the same mechanism to handle whitespace processing for build-in types and enumerations. --- libxsde/xsde/cxx/parser/validating/nmtoken-stl.cxx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'libxsde/xsde/cxx/parser/validating/nmtoken-stl.cxx') 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 (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:: -- cgit v1.1