You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading this in the context of parsing STIX out of a libtaxii object. I think it would be nice if the example included getting a handle on a STIX document out of libtaxii.
To get a libtaxii handle on the message, you'd do (I did not double check to see if this is well documented or not, so perhaps there's a corresponding issue for libtaxii...):
importlibtaxii.messages_11astm11taxii_xml='<taxii_11:Inbox_Message>...</taxii_11:Inbox_Message>'# Use the above XMLmsg=tm11.InboxMessage.from_xml(taxii_xml)
# This prints out the STIX XMLprintmsg.content_blocks[0].content
However, there's no obvious/documented connection to how to get a stix.core.STIXPackage object from here. I ended up with:
fromStringIOimportStringIOfromstix.coreimportSTIXPackagepackage=STIXPackage(StringIO(msg.content_blocks[0].content))
# <stix.core.stix_package.STIXPackage object at 0x7f6d19d6a5d0>
This issue has a couple items:
Is this right? Or is there a cleaner way to go from libtaxii to python-stix
Whatever the "right" way is, it probably makes sense to add it to RTD
If it makes sense, I could add a mechanism to libtaxii to get the content etree directly (currently possible, but hacky).
Thank you.
-Mark
The text was updated successfully, but these errors were encountered:
The only example I can think of that touches on a similar link between documentation efforts is the Working With python-stix for stix-ramrod. We have that documentation in stix-ramrod but we have a link to it on the python-stix index page under Versions. We could do something similar for libtaxii (you host the docs there and we point to it from python-stix). What do you think?
http://stix.readthedocs.org/en/stable/getting_started.html#parsing-stix-xml
I was reading this in the context of parsing STIX out of a libtaxii object. I think it would be nice if the example included getting a handle on a STIX document out of libtaxii.
For instance, take this stub Inbox Message:
To get a libtaxii handle on the message, you'd do (I did not double check to see if this is well documented or not, so perhaps there's a corresponding issue for libtaxii...):
However, there's no obvious/documented connection to how to get a
stix.core.STIXPackage
object from here. I ended up with:This issue has a couple items:
libtaxii
topython-stix
Thank you.
-Mark
The text was updated successfully, but these errors were encountered: