diff options
author | Benoit Foucher <benoit@zeroc.com> | 2002-12-18 23:54:41 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2002-12-18 23:54:41 +0000 |
commit | 474b164454a632fba37e7c30f7d6444033e1df0a (patch) | |
tree | 85ac6f92d12a447519772409c2dcfd8ed0c411d3 /cpp/src/XMLTransform/XMLTransform.cpp | |
parent | fix for handling of missing types (diff) | |
download | ice-474b164454a632fba37e7c30f7d6444033e1df0a.tar.bz2 ice-474b164454a632fba37e7c30f7d6444033e1df0a.tar.xz ice-474b164454a632fba37e7c30f7d6444033e1df0a.zip |
Fix
Diffstat (limited to 'cpp/src/XMLTransform/XMLTransform.cpp')
-rw-r--r-- | cpp/src/XMLTransform/XMLTransform.cpp | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/cpp/src/XMLTransform/XMLTransform.cpp b/cpp/src/XMLTransform/XMLTransform.cpp index f3c7ad75578..9997baed84c 100644 --- a/cpp/src/XMLTransform/XMLTransform.cpp +++ b/cpp/src/XMLTransform/XMLTransform.cpp @@ -894,28 +894,33 @@ public: os << ::IceUtil::attr("length", lstr.str()); - for(i = 0; i < children->getLength(); ++i) + if(l != 0) { - DOMNode* child = children->item(i); - if(child->getNodeType() != DOMNode::ELEMENT_NODE) + for(i = 0; i < children->getLength(); ++i) { - continue; - } + DOMNode* child = children->item(i); + if(child->getNodeType() != DOMNode::ELEMENT_NODE) + { + continue; + } - string nodeName = toString(child->getLocalName()); - if(l == 0 || nodeName != "e") - { - throw SchemaViolation(__FILE__, __LINE__); - } + string nodeName = toString(child->getLocalName()); + if(nodeName != "e") + { + SchemaViolation ex(__FILE__, __LINE__); + ex.reason = "invalid sequence element name: " + nodeName; + throw ex; + } - try - { - _transform->transform(os, info, nodeName, child, map); - } - catch(const MissingTypeException&) - { - // Skip this element - } + try + { + _transform->transform(os, info, nodeName, child, map); + } + catch(const MissingTypeException&) + { + // Skip this element + } + } } os << ::IceUtil::ee; |