MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / startElement

Method startElement

src/openms/source/FORMAT/CVMappingFile.cpp:48–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 void CVMappingFile::startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const Attributes& attributes)
49 {
50
51 tag_ = String(sm_.convert(qname));
52
53 if (tag_ == "CvReference")
54 {
55 // CvReference cvName="PSI-PI" cvIdentifier="PSI-PI"/>
56 CVReference ref;
57 ref.setName(attributeAsString_(attributes, "cvName"));
58 ref.setIdentifier(attributeAsString_(attributes, "cvIdentifier"));
59 cv_references_.push_back(ref);
60 return;
61 }
62
63 if (tag_ == "CvMappingRule")
64 {
65 // id="R1" cvElementPath="/psi-pi:MzIdentML/psi-pi:AnalysisSoftwareList/psi-pi:AnalysisSoftware/pf:ContactRole/pf:role/pf:cvParam" requirementLevel="MUST" scopePath="" cvTermsCombinationLogic="OR
66 actual_rule_.setIdentifier(attributeAsString_(attributes, "id"));
67 String element_path = attributeAsString_(attributes, "cvElementPath");
68 if (strip_namespaces_)
69 {
70 vector<String> slash_split;
71 element_path.split('/', slash_split);
72 if (slash_split.empty())
73 {
74 slash_split.push_back(element_path);
75 }
76 element_path = "";
77 for (vector<String>::const_iterator it = slash_split.begin(); it != slash_split.end(); ++it)
78 {
79 if (it->empty())
80 {
81 continue;
82 }
83
84 vector<String> split;
85 it->split(':', split);
86 if (split.empty())
87 {
88 element_path += "/" + *it;
89 }
90 else
91 {
92 if (split.size() == 2)
93 {
94 element_path += "/" + split[1];
95 }
96 else
97 {
98 fatalError(LOAD, String("Cannot parse namespaces of path: '") + element_path + "'");
99 }
100 }
101 }
102 }
103 actual_rule_.setElementPath(element_path);
104 CVMappingRule::RequirementLevel level = CVMappingRule::MUST;
105 String lvl = attributeAsString_(attributes, "requirementLevel");

Callers

nothing calls this directly

Calls 15

attributeAsString_Function · 0.85
setElementPathMethod · 0.80
setRequirementLevelMethod · 0.80
setScopePathMethod · 0.80
setCombinationsLogicMethod · 0.80
setUseTermMethod · 0.80
setUseTermNameMethod · 0.80
setTermNameMethod · 0.80
setIsRepeatableMethod · 0.80
setAllowChildrenMethod · 0.80
StringClass · 0.50

Tested by

no test coverage detected