Page 1 of 1

Schematron abstract pattern Variable has not been declared (or its declaration is not in scope)

Posted: Tue Jan 28, 2020 2:16 am
by corymosiman12
Trying to create an abstract pattern in a schematron doc and getting the posted error. Pattern is below.

Code: Select all

  <pattern abstract="true" id="floorAreasHaveTypeAndValue">
    <rule context="$parentElement">
      <assert test="auc:FloorArea/auc:FloorAreaType and auc:FloorArea/auc:FloorAreaValue">
        auc:FloorArea elements must specify both a auc:FloorAreaType and auc:FloorAreaValue
      </assert>
    </rule>
  </pattern>
XML Editor 21.1, build 2019071807
macOS 10.14.6

Re: Schematron abstract pattern Variable has not been declared (or its declaration is not in scope)

Posted: Tue Jan 28, 2020 8:52 am
by Radu
Hi,

Maybe you can post a complete Schematron file for which the error message is received.
For example in Oxygen 21.1 if I open and validate this Schematron file it is reported as valid:

Code: Select all

<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
    xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
    <pattern abstract="true" id="floorAreasHaveTypeAndValue">
        <rule context="$parentElement">
            <assert test="auc:FloorArea/auc:FloorAreaType and auc:FloorArea/auc:FloorAreaValue">
                auc:FloorArea elements must specify both a auc:FloorAreaType and auc:FloorAreaValue
            </assert>
        </rule>
    </pattern>
</schema>
Regards,
Radu

Re: Schematron abstract pattern Variable has not been declared (or its declaration is not in scope)

Posted: Fri Jan 31, 2020 10:33 pm
by corymosiman12
Strangely enough, when I moved the function to a different file than the one in which it was used, it worked...is this expected behavior? Does an abstract function need to be defined in a file external to the file in which it is instantiated?

Re: Schematron abstract pattern Variable has not been declared (or its declaration is not in scope)

Posted: Mon Feb 03, 2020 8:54 am
by Radu
Hi,

As you did not post complete samples with which the original problem could be reproduced I cannot precisely tell you what was wrong.
Abstract patterns can stay either in the same Schematron file or in other Schematron files included directly or indirectly by the current schematron file.

Regards,
Radu

Re: Schematron abstract pattern Variable has not been declared (or its declaration is not in scope)

Posted: Thu Feb 06, 2020 11:44 pm
by corymosiman12
That's ok. Sorry, I am now no longer able to reproduce, else I would post the actual files...thanks for your response though!