Author: jkupec Date: Wed May 30 15:18:43 2007 New Revision: 5645 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5645&view=rev Log: comments Modified: trunk/libzypp/zypp/parser/yum/RepomdFileReader.cc trunk/libzypp/zypp/parser/yum/RepomdFileReader.h trunk/libzypp/zypp/parser/yum/schema/repomd.rnc trunk/libzypp/zypp/parser/yum/schema/repomd.rng Modified: trunk/libzypp/zypp/parser/yum/RepomdFileReader.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/RepomdFileReader.cc?rev=5645&r1=5644&r2=5645&view=diff ============================================================================== --- trunk/libzypp/zypp/parser/yum/RepomdFileReader.cc (original) +++ trunk/libzypp/zypp/parser/yum/RepomdFileReader.cc Wed May 30 15:18:43 2007 @@ -77,7 +77,7 @@ /** Type of metadata file. */ source::yum::YUMResourceType _type; - /** Function for processing collected data. Passed in through constructor. */ + /** Function for processing collected data. Passed-in through constructor. */ ProcessResource _callback; /** Checksum of metadata file */ @@ -103,29 +103,46 @@ // -------------------------------------------------------------------------- + /* + * xpath and multiplicity of processed nodes are included in the code + * for convenience: + * + * // xpath: <xpath> (?|*|+) + * + * if multiplicity is ommited, then the node has multiplicity 'one'. + */ + + // -------------------------------------------------------------------------- + bool RepomdFileReader::Impl::consumeNode( Reader & reader_r ) { - //MIL << reader_r->name() << endl; - std::string data_type; if ( reader_r->nodeType() == XML_READER_TYPE_ELEMENT ) { + // xpath: /repomd if ( reader_r->name() == "repomd" ) { _tag = tag_Repomd; return true; } + + // xpath: /repomd/data if ( reader_r->name() == "data" ) { _tag = tag_Data; _type = YUMResourceType(reader_r->getAttribute("type").asString()); return true; } + + // xpath: /repomd/location if ( reader_r->name() == "location" ) { _tag = tag_Location; _location.filename( reader_r->getAttribute("href").asString() ); + // ignoring attribute xml:base return true; } + + // xpath: /repomd/checksum if ( reader_r->name() == "checksum" ) { _tag = tag_CheckSum; @@ -134,19 +151,29 @@ _location.checksum( CheckSum( checksum_type, checksum_vaue ) ); return true; } + + // xpath: /repomd/timestamp if ( reader_r->name() == "timestamp" ) { // ignore it return true; } + + // xpath: /repomd/open-checksum (?) } + else if ( reader_r->nodeType() == XML_READER_TYPE_END_ELEMENT ) { - //MIL << "end element" << endl; + // xpath: /repomd/data if ( reader_r->name() == "data" ) - _callback( _location, _type ); - return true; + { + if (_callback) + _callback( _location, _type ); + + return true; + } } + return true; } Modified: trunk/libzypp/zypp/parser/yum/RepomdFileReader.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/RepomdFileReader.h?rev=5645&r1=5644&r2=5645&view=diff ============================================================================== --- trunk/libzypp/zypp/parser/yum/RepomdFileReader.h (original) +++ trunk/libzypp/zypp/parser/yum/RepomdFileReader.h Wed May 30 15:18:43 2007 @@ -78,10 +78,10 @@ }; - } - } -} - -#endif + } // ns yum + } // ns parser +} // ns zypp +#endif /*zypp_source_yum_RepomdFileReader_H*/ +// vim: set ts=2 sts=2 sw=2 et ai: Modified: trunk/libzypp/zypp/parser/yum/schema/repomd.rnc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/schema/repomd.rnc?rev=5645&r1=5644&r2=5645&view=diff ============================================================================== --- trunk/libzypp/zypp/parser/yum/schema/repomd.rnc (original) +++ trunk/libzypp/zypp/parser/yum/schema/repomd.rnc Wed May 30 15:18:43 2007 @@ -1,3 +1,24 @@ +# YUM repository index file schema. +# +# Upstream version: http://linux.duke.edu/projects/metadata/dtd/repomd.dtd +# +# Elements: +# +# repomd +# Root element. May contain text (e.g. repository description?). +# "patches", "patterns", and "products" are SUSE extensions to the upstream schema. +# data +# Repository file data. Contains location, checksum, timestamp of the metadata file. +# location +# Location of the metadata file. 'href' attribute contains path of the file, relative +# to the repository root. 'xml:base' attribute seems to be unused. +# checksum +# Type and value of checksum of the metadata file. +# timestamp +# Timestamp of the metadata file in the repository. +# open-checksum +# ? + default namespace = "http://linux.duke.edu/metadata/repo" element repomd { Modified: trunk/libzypp/zypp/parser/yum/schema/repomd.rng URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/schema/repomd.rng?rev=5645&r1=5644&r2=5645&view=diff ============================================================================== --- trunk/libzypp/zypp/parser/yum/schema/repomd.rng (original) +++ trunk/libzypp/zypp/parser/yum/schema/repomd.rng Wed May 30 15:18:43 2007 @@ -1,4 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + YUM repository index file schema. + + Upstream version: http://linux.duke.edu/projects/metadata/dtd/repomd.dtd + + Elements: + + repomd + Root element. May contain text (e.g. repository description?). + "patches", "patterns", and "products" are SUSE extensions to the upstream schema. + data + Repository file data. Contains location, checksum, timestamp of the metadata file. + location + Location of the metadata file. 'href' attribute contains path of the file, relative + to the repository root. 'xml:base' attribute seems to be unused. + checksum + Type and value of checksum of the metadata file. + timestamp + Timestamp of the metadata file in the repository. + open-checksum + ? +--> <element name="repomd" ns="http://linux.duke.edu/metadata/repo" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <interleave> <oneOrMore> -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org