Why should it? Even the linked validation schema shows that there can be zero or more occurences of <location>. Xml doesn't need an enclosing element for 'arrays', like e.g. Json does.
I've parsed it successfully, written xsl styles (to HTML) for it and our used Jenkins plugin also can parse it.
How are you trying to parse it? Maybe showing your implementation could help.
Last edit: anoy. 2020-07-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes it is valid XML. It would probably be better to separate the locations as you suggest but I do not want to break the xml format since there are lots of tools and scripts that use it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If we ever need to change the xml format we can add a --xml-version=3 option.. but well I do not believe there is a strong reason for that right now. If that is added then --xml-version=2 will continue to be used default for a couple of years.. so people have time to update their tools and scripts. So when we invent a new xml format we will have 2 xml format outputs in our code for years.
If we add a new xml format .. HtmlReport should handle both --xml-version=2 and --xml-version=3 output so I imagine that script will become more complex. The HtmlReport even handles version 1.. I believe we removed that format from cppcheck a few years ago so it can be removed from HtmlReport also.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes, --xml-version=3 would be really helpful. I have many xml from which I do parsing and get the results into the db... untill the version 3 is released i will do with the if-Statements though it makes the overall import process slower.
Please do keep this in the bucket list for Version 3.
Thanks for the support. I really appreciate.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi There,
Iam trying to parse the xml data from the output of cppcheck.. But the XML structure seems wrong..
XSD
but shouldnt the location node be an Array..??
Last edit: zubair Shaik 2020-07-01
Why should it? Even the linked validation schema shows that there can be zero or more occurences of
<location>
. Xml doesn't need an enclosing element for 'arrays', like e.g. Json does.I've parsed it successfully, written xsl styles (to HTML) for it and our used Jenkins plugin also can parse it.
How are you trying to parse it? Maybe showing your implementation could help.
Last edit: anoy. 2020-07-01
Yes it is valid XML. It would probably be better to separate the locations as you suggest but I do not want to break the xml format since there are lots of tools and scripts that use it.
@anoy why should it be..? because its called Object Oriented programming... it shows valid XML because it only does basic checks for validaty.. I
@DanielMarjamäki:
Okay i understand.. would you be considering perhaps for the next Version..?
I checked out HtmlReport i see too many if statements whcih i really wanted to avoid...
If we ever need to change the xml format we can add a
--xml-version=3
option.. but well I do not believe there is a strong reason for that right now. If that is added then--xml-version=2
will continue to be used default for a couple of years.. so people have time to update their tools and scripts. So when we invent a new xml format we will have 2 xml format outputs in our code for years.If we add a new xml format .. HtmlReport should handle both
--xml-version=2
and--xml-version=3
output so I imagine that script will become more complex. The HtmlReport even handles version 1.. I believe we removed that format from cppcheck a few years ago so it can be removed from HtmlReport also.@DanielMarjamäki:
yes,
--xml-version=3
would be really helpful. I have many xml from which I do parsing and get the results into the db... untill the version 3 is released i will do with the if-Statements though it makes the overall import process slower.Please do keep this in the bucket list for Version 3.
Thanks for the support. I really appreciate.