-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separating Content of Multiple Elements with the Same Name #334
Comments
Hi, Analyzed the schema the related data is bound with a complex mixed content, and this is the reason of (maybe unwanted) string concatenation. Before that I've also to resolve a validation issue of
I hope to produce a fix for next release. Thank you |
Hi @TrustArgon, found the problem with validation issue of xs = self.schema_class(xsd_file)
result = xs.decode(xml_file)
body_text = result['Demonstrative_Example'][0]['Body_Text']
print(body_text)
# ['The snippet of code below establishes a new cookie to hold the sessionID.', 'The HttpOnly flag is not set for the cookie. An attacker who can perform XSS could insert malicious script such as:', 'When the client loads and executes this script, it makes a request to the attacker-controlled web site. The attacker can then log the request and steal the cookie.', 'To mitigate the risk, use the setHttpOnly(true) method.'] Could you try my test files with the same environment? Thank you |
I assume this issue is resolved, otherwise re-open. |
When processing an XML document, xmlschema concatenates the contents of multiple elements with the same name into a single value of a dictionary with the key of the elements name. Is there a way to force unique key values when multiple elements of the same name are present so the result is a list of dictionaries or a dictionary containing unique key:value pairs for each instance?
The example I'm working with is the xml of the CWE Database found at: CWE Database XML ZIP File
The schema can be found at: CWE Database XSD File
Below is the section of the XSD im working with, the element in question is named 'Body_Text':
A sample of the xml code that results in my question is as follows:
The following shows the part of the object relevant to the question that is generated:
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: