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
What you're seeing is due to how lxml, the underlying XML library that libtaxii uses, treats empty XML elements (<element/> is equivalent to <element></element>) and the fact that I've never run into this edge case before. I agree that what your seeing is unexpected (and therefore should be changed), but I'm having trouble figuring out what the change should be.
The two options that jump to my mind are:
Treat Parameter.text == None as an empty string instead.
Raise an error when Parameter.text == None
I think that the use cases that you and other are attempting to support will help guide the right choice. Are you trying to do something where matching on an empty string is desirable? Or is it just something you ran into? If it's the former, #1 might be a better options. If it's the latter, #2 might be the better option.
Let me know what you think - this is certainly interesting.
Thanks Mark, I really just ran into it. I'm assembling dynamic TAXII Queries given form field entries and I noticed this and it got me thinking....is it conceivable that someone would want to query for a blank parameter value and, if so, how would that be communicated using an XML message binding.
Assembling a DefaultQuery object from an XML string that contains a blank Parameter value results in that value being assigned the string 'None'.
Example (Note 2nd Parameter tag is empty string):
The text was updated successfully, but these errors were encountered: