Created
March 1, 2010 08:30
-
-
Save csytan/318200 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xml.etree import ElementTree | |
tree = ElementTree.fromstring( | |
"""<?xml version="1.0"?> | |
<result> | |
<mediaid>[MediaID]</mediaid> | |
<source>[SourceFile]</source> | |
<status>[MediaStatus]</status> | |
<description>[ ErrorDescription]</description> <!-- Only in case of Status = Error --> | |
<format> | |
<output>[OutputFormat]</output> | |
<destination>[DestFile]</destination> <!-- Only in case of Status = Finished --> | |
<status>[TaskStatus]</status> | |
<description>[ErrorDescription]</description> <!-- Only in case of Status = Error --> | |
<suggestion>[ErrorSuggestion]</suggestion> <!-- Only in case of Status = Error --> | |
</format> | |
</result> | |
""") | |
print tree.findtext('mediaid') | |
print tree.findtext('source') | |
print tree.findtext('status') | |
print tree.findtext('format/description') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment