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 » Tue Jan 28, 2020 2:16 am

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: 6981
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 » Tue Jan 28, 2020 8:52 am

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 » Fri Jan 31, 2020 10:33 pm

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: 6981
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 » Mon Feb 03, 2020 8:54 am

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 » Thu Feb 06, 2020 11:44 pm

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