XbimEssentials icon indicating copy to clipboard operation
XbimEssentials copied to clipboard

The location of the schema files have changed

Open klacol opened this issue 5 years ago • 5 comments

There is now a new official location for chema files, see here: https://forums.buildingsmart.org/t/new-location-of-schema-files-xsd/1583/4

XBim essentials should change the URI to the new location, when writing ifcXML files.

klacol avatar Sep 28 '19 21:09 klacol

Hi Klaus

Thanks for this. We hit this relocation of BSa's XSD earlier in the year (#273) in relation to some tests...

I think the latest xbim v5.1 code handles this new change (which is really only an issue when you're validating the IfcXML against a schema when opening a file - an optional.)

My understanding on the BuildingSmart hosting change is that we're not changing anything when writing ifcXml (for any Ifc schema version). In fact, doing so would retrospectively break a published standard? It's just that the xml Xsd 'namespace' maps to a different URI to access the XSD required to validate the xml file.

E.g. as per https://github.com/xBimTeam/XbimEssentials/blob/cb6bfe1440201d8bf3f9ae1922635274011dacfc/Xbim.IO.MemoryModel/Xml/XbimXmlSettings.cs#L25

... given an IfcXml file with a schema of http://www.buildingsmart-tech.org/ifcXML/IFC4/final Xbim will now look for an XSD at https://standards.buildingsmart.org/IFC/RELEASE/IFC4/FINAL/XML/ifcXML4.xsd rather than wherever it was previously at http://www.buildingsmart-tech.org/ifc/

So I don't believe there's anything more we need to do unless you know better?

andyward avatar Sep 29 '19 14:09 andyward

Hi @klacol, can you provide a test which would demonstrate the problem? As Andy pointed out, we have already reflected the schema location change in xBIM so any newly created files should point to the current location.

martin1cerny avatar Oct 01 '19 09:10 martin1cerny

Hi @martin1cerny, @andyward ,

thanks for the fast response. I am working with XBim on the examples generator for our CEN product data library. See my code here:

https://github.com/buildingSMART/ProductData/blob/master/Tools/ExampleGenerator/LibraryExamples/ProductDataLibrary.cs#L444

When creating an ifcXML file with XBim I get this header:

<ifcXML 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:xlink="http://www.w3.org/1999/xlink" 
     xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add2" 
     xsi:schemaLocation="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add2 http://www.buildingsmart-tech.org/ifc/IFC4/Add2/IFC4_ADD2.xsd" 
     id="uos_1" 
     express="http://www.buildingsmart-tech.org/ifc/IFC4/Add2/IFC4_ADD2.exp" 
     configuration="http://www.buildingsmart-tech.org/ifc/IFC4/Add2/IFC4_ADD2_config.xml" 
     xmlns="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add2"
>

The xsi:schemaLocation element relates the namespace http://www.buildingsmart-tech.org/ifcXML/IFC4/Add2 to the schema location http://www.buildingsmart-tech.org/ifc/IFC4/Add2/IFC4_ADD2.xsd. This location does not exist anymore. When I hit the validate button in my XML editor, the tool tries to access the schema at the configured location and cannot access the XSD file there. Since they did not provide rewrite rules on the new server, the new schema location could be changed to the new online location. The actual locations are listed here:

https://technical.buildingsmart.org/standards/ifc/ifc-schema-specifications/

In my case it would be https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/XML/IFC4.xsd, so the new header would look like this:

<ifcXML 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:xlink="http://www.w3.org/1999/xlink" 
     xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add2" 
     xsi:schemaLocation="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add2 https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/XML/IFC4.xsd" 
     id="uos_1" 
     express="http://www.buildingsmart-tech.org/ifc/IFC4/Add2/IFC4_ADD2.exp" 
     configuration="http://www.buildingsmart-tech.org/ifc/IFC4/Add2/IFC4_ADD2_config.xml" 
     xmlns="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add2"
>

klacol avatar Oct 01 '19 13:10 klacol

Perhaps I am using an too old version of XBim?

klacol avatar Oct 01 '19 13:10 klacol

Yes, the CEN tooling needs to be updated.

martin1cerny avatar Oct 02 '19 06:10 martin1cerny