diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-05-04 18:20:24 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-05-04 18:20:24 +0200 |
commit | 569cfb24dc772badffe06494aa39ec6634f85fcd (patch) | |
tree | 82e87db50cdb0d63ca65a0e6f2ab1d932005fb08 | |
parent | 03882ff89f51d017e5293bec4f4e9c4b95a5b031 (diff) | |
parent | 297b4bd2c5bd5ed5e62f560a8b60c1d04903455b (diff) |
Merge branch 'xsd-3'
-rw-r--r-- | examples/cxx/tree/streaming/parser.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/examples/cxx/tree/streaming/parser.cxx b/examples/cxx/tree/streaming/parser.cxx index b0d9df7..f593a14 100644 --- a/examples/cxx/tree/streaming/parser.cxx +++ b/examples/cxx/tree/streaming/parser.cxx @@ -220,9 +220,17 @@ startElement (const XMLCh* const uri, for (unsigned int i (0), end (attr.getLength()); i < end; ++i) #endif { - cur_->setAttributeNS (attr.getURI (i), - attr.getQName (i), - attr.getValue (i)); + const XMLCh* qn (attr.getQName (i)); + const XMLCh* ns (attr.getURI (i)); + + // When SAX2 reports the xmlns attribute, it does not include + // the proper attribute namespace. So we have to detect and + // handle this case. + // + if (XMLString::equals (qn, XMLUni::fgXMLNSString)) + ns = XMLUni::fgXMLNSURIName; + + cur_->setAttributeNS (ns, qn, attr.getValue (i)); } depth_++; |