Skip to content

Commit

Permalink
Revert; old way is only way that works.
Browse files Browse the repository at this point in the history
  • Loading branch information
luciansmith committed Feb 16, 2024
1 parent 8925485 commit 795e370
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions biosimulators_utils/sedml/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,8 @@ def validate_target(target, namespaces, context, language, model_id, model_etree
namespaces = dict(namespaces)
namespaces.pop(None, None)

try:
xpath = lxml.etree.XPath(target, namespaces=namespaces)
root = lxml.etree.Element("root")
try:
root.xpath(target, namespaces=namespaces)
Expand Down Expand Up @@ -1706,8 +1708,9 @@ def validate_target(target, namespaces, context, language, model_id, model_etree
ns_message = 'No namespaces are defined for the target.'

errors.append(['One or more namespaces required for target `{}` are not defined. {}'.format(target, ns_message)])
else:
errors.append(['Target `{}` is not a valid XML XPath.'.format(target)])

except lxml.etree.XPathSyntaxError:
errors.append(['Target `{}` is not a valid XML XPath.'.format(target)])

return errors, warnings

Expand Down

0 comments on commit 795e370

Please sign in to comment.