| 92 | = default; |
| 93 | |
| 94 | void MzIdentMLHandler::startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const xercesc::Attributes& attributes) |
| 95 | { |
| 96 | tag_ = sm_.convert(qname); |
| 97 | open_tags_.push_back(tag_); |
| 98 | |
| 99 | static set<String> to_ignore; |
| 100 | if (to_ignore.empty()) |
| 101 | { |
| 102 | to_ignore.insert("peptideSequence"); |
| 103 | } |
| 104 | |
| 105 | if (to_ignore.find(tag_) != to_ignore.end()) |
| 106 | { |
| 107 | return; |
| 108 | } |
| 109 | |
| 110 | //determine parent tag |
| 111 | String parent_tag; |
| 112 | if (open_tags_.size() > 1) |
| 113 | { |
| 114 | parent_tag = *(open_tags_.end() - 2); |
| 115 | } |
| 116 | String parent_parent_tag; |
| 117 | if (open_tags_.size() > 2) |
| 118 | { |
| 119 | parent_parent_tag = *(open_tags_.end() - 3); |
| 120 | } |
| 121 | |
| 122 | if (tag_ == "cvParam") |
| 123 | { |
| 124 | static const XMLCh* s_value = xercesc::XMLString::transcode("value"); |
| 125 | static const XMLCh* s_unit_accession = xercesc::XMLString::transcode("unitAccession"); |
| 126 | static const XMLCh* s_cv_ref = xercesc::XMLString::transcode("cvRef"); |
| 127 | //~ static const XMLCh* s_name = xercesc::XMLString::transcode("name"); |
| 128 | static const XMLCh* s_accession = xercesc::XMLString::transcode("accession"); |
| 129 | |
| 130 | String value, unit_accession, cv_ref; |
| 131 | optionalAttributeAsString_(value, attributes, s_value); |
| 132 | optionalAttributeAsString_(unit_accession, attributes, s_unit_accession); |
| 133 | optionalAttributeAsString_(cv_ref, attributes, s_cv_ref); |
| 134 | handleCVParam_(parent_parent_tag, parent_tag, attributeAsString_(attributes, s_accession), /* attributeAsString_(attributes, s_name), value, */ attributes, cv_ref /*, unit_accession */); |
| 135 | return; |
| 136 | } |
| 137 | |
| 138 | if (tag_ == "MzIdentML") |
| 139 | { |
| 140 | // TODO handle version with mzid 1.2 release |
| 141 | return; |
| 142 | } |
| 143 | |
| 144 | if (tag_ == "Peptide") |
| 145 | { |
| 146 | // start new peptide |
| 147 | actual_peptide_ = AASequence(); |
| 148 | |
| 149 | // name attribute (opt) |
| 150 | String name; |
| 151 | if (optionalAttributeAsString_(name, attributes, "name")) |
nothing calls this directly
no test coverage detected