From 2544ac20b439e160b7c89bdbeafa19cadcc89e25 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Oct 2010 11:35:29 +0200 Subject: Handle multiple patterns --- xsd-frontend/parser.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xsd-frontend/parser.cxx b/xsd-frontend/parser.cxx index 576a7ca..fc14f8f 100644 --- a/xsd-frontend/parser.cxx +++ b/xsd-frontend/parser.cxx @@ -3096,6 +3096,7 @@ namespace XSDFrontend Facets facets; Restricts* restricts (0); + String pattern; while (more ()) { @@ -3145,7 +3146,10 @@ namespace XSDFrontend } else if (name == L"pattern") { - facets[name] = e["value"]; + if (pattern) + pattern += L'|'; + + pattern += e["value"]; } else { @@ -3157,6 +3161,9 @@ namespace XSDFrontend } } + if (pattern) + facets[L"pattern"] = pattern; + if (enum_) pop_scope (); else @@ -3551,6 +3558,7 @@ namespace XSDFrontend } Facets facets; + String pattern; while (more ()) { @@ -3592,7 +3600,10 @@ namespace XSDFrontend } else if (name == L"pattern") { - facets[name] = e["value"]; + if (pattern) + pattern += L'|'; + + pattern += e["value"]; } else if (name == L"attribute") { @@ -3619,6 +3630,9 @@ namespace XSDFrontend } } + if (pattern) + facets[L"pattern"] = pattern; + Complex& type (dynamic_cast (scope ())); Restricts* restricts = set_type (base, r, type); -- cgit v1.1