Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better error message for wrong measurment model (order) #21

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion fluxml/MMModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,30 @@
child = XMLElement::nextNode(child);
}


// es dürfen keine Elemente mehr folgen!
if (child != 0)
fTHROW(XMLException,child,"unexpected extra content in element \"model\"");
{
// either wrong order of elements, or unknown element
if (XMLElement::match(child,mm_labelingmeasurement,mm_xmlns_uri) ||
XMLElement::match(child,mm_fluxmeasurement,mm_xmlns_uri) ||
XMLElement::match(child,mm_fluxratios,mm_xmlns_uri) ||
XMLElement::match(child,mm_poolsizeratios,mm_xmlns_uri) ||
XMLElement::match(child,mm_poolmeasurement,mm_xmlns_uri) ||
XMLElement::match(child,mm_poolsizemeasurement,mm_xmlns_uri))
{
fTHROW(XMLException, child, "wrong oder of elements inside "
"\"model\". Correct order is \"labelingmeasurement\""
", \"fluxmeasurement\", \"fluxratios\", "
"\"poolsizeratios\", \"poolsizemeasurement\"");
}
else
{
fTHROW(XMLException, child, "unexpected extra content "
"\"%s\" in element \"model\"",
XMLElement::nodeToString(child));
}
}
}

void MMModel::parseLabelingMeasurement(DOMNode * labelingmeasurement)
Expand Down