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

Oxygen general issues.
corymosiman12
Posts: 6
Joined: Tue Jan 28, 2020 2:05 am

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

Post 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
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
corymosiman12
Posts: 6
Joined: Tue Jan 28, 2020 2:05 am

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

Post 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?
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
corymosiman12
Posts: 6
Joined: Tue Jan 28, 2020 2:05 am

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

Post 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!
Post Reply