diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-28 16:53:35 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-28 16:53:35 +0200 |
commit | 4332a60585a14ff51bc54d29a4a81d37b3b1df81 (patch) | |
tree | fd3b807e3f5b3841371d509505a50498d21a2f99 /libxsde/xsde/cxx/serializer/validating/string.cxx | |
parent | c2d201480002a24c05f1f4bc934036555b79cad6 (diff) |
Validate enumerations in the xsd:string parser/serializer
Diffstat (limited to 'libxsde/xsde/cxx/serializer/validating/string.cxx')
-rw-r--r-- | libxsde/xsde/cxx/serializer/validating/string.cxx | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/libxsde/xsde/cxx/serializer/validating/string.cxx b/libxsde/xsde/cxx/serializer/validating/string.cxx index 0def094..befe450 100644 --- a/libxsde/xsde/cxx/serializer/validating/string.cxx +++ b/libxsde/xsde/cxx/serializer/validating/string.cxx @@ -3,8 +3,8 @@ // copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -#include <string.h> // strlen #include <xsde/cxx/serializer/validating/string.hxx> +#include <xsde/cxx/serializer/validating/string-common.hxx> namespace xsde { @@ -30,31 +30,7 @@ namespace xsde void string_simpl:: _serialize_content () { - // Check facets. - // - if (length_set_ || min_length_set_ || max_length_set_) - { - size_t n = strlen (value_); - const facets& f = _facets (); - - if (f.length_set_ && n != f.length_) - { - _schema_error (schema_error::length_not_equal_prescribed); - return; - } - - if (f.min_length_set_ && n < f.min_length_) - { - _schema_error (schema_error::length_less_than_min); - return; - } - - if (f.max_length_set_ && n > f.max_length_) - { - _schema_error (schema_error::length_greater_than_max); - return; - } - } + string_common::validate_facets (value_, _facets (), _context ()); _characters (value_); |