pnnl / assetscore-schematron-docs

Schematron XML documents for Building Energy Asset Score
Other
3 stars 2 forks source link

Attribute 'title' and attribute 'name' not allowed #1

Closed corymosiman12 closed 4 years ago

corymosiman12 commented 4 years ago

Hey @markborkum, just came across this when trying to run schematron validation in OxygenXML. If I delete the name and title attributes, then the validation works, however, it won't run a validation unless I delete these. Is this an OxygenXML issue?

Screen Shot 2019-11-06 at 3 08 53 PM

Screen Shot 2019-11-06 at 3 12 10 PM

markborkum commented 4 years ago

@corymosiman12 Presumably. My guess is that OxygenXML is attempting to validate the XML content of the Schematron document, but cannot find the XSD file for the "sch" XML namespace. To make the Schematron document compatible with OxygenXML, try adding the following attributes to the <sch:schema> element:

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="path/to/schematron.xsd"

where path/to/schematron.xsd is the relative path.

corymosiman12 commented 4 years ago

You're saying to add those attributes into the Schematron XML file? Where would I get a schematron.xsd file? I thought that was all embedded as part of the Schematron standard?

markborkum commented 4 years ago

@corymosiman12 Correct. On the Schematron website, on the "Implementation" page, in the "Resources" section, there is a link to the RELAX NG schema for ISO Schematron 2016. You can use a "Conversion Tool" to convert from RELAX NG to XSD format, e.g., Trang.

corymosiman12 commented 4 years ago

ok so I found this iso-schematron.xsd.

It's saved here: /Users/cmosiman/Downloads/iso-schematron.xsd

I added title to the schema element: Screen Shot 2019-11-06 at 5 03 48 PM

I also added name to the pattern element: Screen Shot 2019-11-06 at 5 08 12 PM

I added this to my New_York...xml file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://purl.oclc.org/dsdl/schematron /Users/cmosiman/Downloads/iso-schematron.xsd" (they are also both in the downloads folder, so I tried: ./iso-schematron.xsd and iso-schematron.xsd as well. Am still getting the same errors...doing anything obviously wrong?

markborkum commented 4 years ago

@corymosiman12 Thanks for your efforts. I've updated the Schematron document to conform to that XSD file.

corymosiman12 commented 4 years ago

@markborkum other errors went away...but...getting this with the new file... image

markborkum commented 4 years ago

@corymosiman12 We're getting close. The error message is correct. 3c602a8d1817aff13ac71dac7852c27bcf92f470 should resolve this issue.

corymosiman12 commented 4 years ago

@markborkum woohoo! thanks, working as expected!