Hi Nico,

 

I’m glad you asked – I put out a very preliminary XML schema, but I don’t feel 
qualified to create even a draft of an authoritative schema.

 

We could use some help here.

 

Here’s an issue tracking this in the SPDX Spec: 
https://github.com/spdx/spdx-spec/issues/615

 

Please feel free to pick this up.

 

I would like to generate the XML schema in a similar fashion to the JSON schema 
– I can definitely help with the Java code to generate once the schema itself 
is determined – but feel free to contribute to that as well.

 

Here’s a start at an XSD generator utility: 
https://github.com/spdx/tools-java/blob/master/src/main/java/org/spdx/tools/schema/OwlToXsd.java.
  Of course it will need to be updated once we know what the XSD is to look 
like.

 

Gary

 

 

 

From: [email protected] <[email protected]> On Behalf Of Nicolaus 
Weidner via lists.spdx.org
Sent: Monday, October 31, 2022 7:16 AM
To: [email protected]
Subject: [spdx-tech] Official spdx xml schema?

 

Hi all,

I was wondering whether there is any official (or semi-official) schema for the 
xml file format. My current assumption is that it follows the json schema 
wherever possible.
I have to say "wherever possible" because some differences cannot be avoided. I 
am aware of the following:

*       There needs to be a root element, so there is a top-level <Document> 
element containing all properties
*       List representations look weird to me: For example, one can currently 
find multiple successive <packages>...</packages> elements in one document 
(e.g. 
https://github.com/spdx/tools-java/blob/92e1c5d29eacb0081139b0c05e5e6270b231788c/testResources/SPDXXMLExample-v2.3.spdx.xml#L254-L276).
 I would prefer single <package> elements wrapped in an enclosing <packages> 
element at this point. Alternatively, at least each single element should be 
named using singular even if there is no enclosing element.


So, back to the original question: Is there any official definition for the xml 
schema? Or does one just look at the json schema and if in doubt, look at some 
examples (which seems dangerous to me, because examples can contain errors...)?

Best,
Nico 





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#4819): https://lists.spdx.org/g/Spdx-tech/message/4819
Mute This Topic: https://lists.spdx.org/mt/94686073/21656
Group Owner: [email protected]
Unsubscribe: https://lists.spdx.org/g/Spdx-tech/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to