csaf-tools / CVRF-CSAF-Converter

A CVRF CSAF Converter, taking care about OASIS specification.
https://www.telekom.com/security
MIT License
10 stars 4 forks source link

Implement Language conversion #84

Open tschmidtb51 opened 2 years ago

tschmidtb51 commented 2 years ago

The conformance clause 5: CVRF CSAF converter states the conversion rule for the document language:

/document/lang: If one or more CVRF element containing an xml:lang attribute exist and contain the exact same value, the CVRF CSAF converter converts this value into lang. If the values of xml:lang attributes are not equal, the CVRF CSAF converter outputs a warning that the language could not be determined and possibly a document with multiple languages was produced. In addition, it SHOULD also present all values of xml:lang attributes as a set in the warning.

This must be implemented in the CVRF-CSAF converter to be conformant.

cgi1 commented 2 years ago

Dear @tschmidtb51,

going back to the beginning of the project we defined in #4 how the conformance clause 5 has been specified for the project. You actually added the /document/lang requirement way later as we already finished this area. We do not consider this as a bug, as the specification has been implemented as agreed during kick off.

tschmidtb51 commented 2 years ago

Dear @cgi1, I'm sorry for the confusion this caused. I know that this one is not in the scope of the original project. Therefore, I didn't label it with acceptance. However, I found it during my tests, so I wanted to document it to make sure, I don't forget about it before claiming officially conformance against clause 5.

cgi1 commented 2 years ago

Thank you @tschmidtb51 for clearing up the confusion here! It absolutly makes sense to add issues for later adoption of the code.

tschmidtb51 commented 1 year ago

The basic idea could be to use XPath and get all xml:lang elements as array and then process them.

tschmidtb51 commented 1 year ago

And the XPath to get all xml:lang elements is //@xml:lang. That should result in an array.

sthagen commented 1 year ago

I will start implementation today 🤞🏽