@@ -245,7 +245,8 @@ class Tailoring:
245245 root .set ("id" , self .id )
246246
247247 benchmark = ET .SubElement (root , "{%s}benchmark" % NS )
248- datastream_uri = self ._get_datastream_uri ()
248+ datastream_uri = pathlib .Path (
249+ self .original_ds_filename ).absolute ().as_uri ()
249250 benchmark .set ("href" , datastream_uri )
250251
251252 version = ET .SubElement (root , "{%s}version" % NS )
@@ -255,6 +256,8 @@ class Tailoring:
255256 profile = ET .SubElement (root , "{%s}Profile" % NS )
256257 profile .set ("id" , self ._full_profile_id (self .profile_id ))
257258 profile .set ("extends" , self ._full_profile_id (self .extends ))
259+ if self .extends :
260+ profile .set ("extends" , self ._full_profile_id (self .extends ))
258261
259262 # Title has to be there due to the schema definition.
260263 title = ET .SubElement (profile , "{%s}title" % NS )
@@ -336,7 +339,8 @@ class Tailoring:
336339 raise ValueError ("JSON Tailoring does not define any profiles." )
337340
338341 self .extends = tailoring ["base_profile_id" ]
339-
342+ if not tailoring .get ("base_profile_id" ) and not tailoring .get ("id" ):
343+ raise ValueError ("You must define a base_profile_id or an id" )
340344 self .profile_id = tailoring .get ("id" , self .profile_id )
341345 self .profile_title = tailoring .get ("title" , self .profile_title )
342346
0 commit comments