def version_from_schema(schema_el):
vc_el = schema_el<EOL>while True:<EOL><INDENT>vc_el = vc_el.getprevious()<EOL>if vc_el is None:<EOL><INDENT>break<EOL><DEDENT>if vc_el.tag is etree.Comment:<EOL><INDENT>match = VERSION_COMMENT.search(vc_el.text)<EOL>if match:<EOL><INDENT>try:<EOL><INDENT>return match.group(<NUM_LIT:1>)<EOL><DEDENT>except IndexError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT>raise VersionNotFound('<STR_LIT>')<EOL>
returns: API version number <str>
raises: <VersionNotFound>

NOTE:
relies on presence of comment tags in the XSD, which are currently present
for both ebaySvc.xsd (TradingAPI) and ShoppingService.xsd (ShoppingAPI)