ref: refs/heads/master commit 527ee0b8adfe124a95953d36ab4c99d26eec7042 Author: Michael Andres <ma@suse.de> Date: Wed Feb 4 17:11:51 2009 +0100 Let xml::ParseDef skip initial comments. --- zypp/parser/xml/ParseDef.cc | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/zypp/parser/xml/ParseDef.cc b/zypp/parser/xml/ParseDef.cc index 58b1a8a..04dcdae 100644 --- a/zypp/parser/xml/ParseDef.cc +++ b/zypp/parser/xml/ParseDef.cc @@ -241,7 +241,21 @@ namespace zypp { if ( reader_r->nodeType() != XML_READER_TYPE_ELEMENT ) { - ZYPP_THROW( ParseDefValidateException( exstr("Expected ELEMENT", *this, reader_r) ) ); + if ( reader_r->depth() == 0 ) + { + // on the verry first level we skip any initial whitespace and comments... + do { + // advance to next node + if ( ! reader_r.nextNode() ) + { + ZYPP_THROW( ParseDefValidateException( exstr( "Unexpected EOF ", *this ) ) ); + } + } while( reader_r->nodeType() != XML_READER_TYPE_ELEMENT ); + } + else + { + ZYPP_THROW( ParseDefValidateException( exstr("Expected ELEMENT", *this, reader_r) ) ); + } } if ( reader_r->name() != _name ) { @@ -320,6 +334,7 @@ namespace zypp break; default: + //DBG << exstr("SKIP ", *this, reader_r) << endl; break; } } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org