Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

expand variables in value attributes too #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

halex2005
Copy link

Hi!

I found an issue for expand abstract patterns.

I need to declare abstract pattern which uses external function inside (I use custom extensibility functions for .NET XslCompiledTransform) and I need to pass external parameter to this function. Then I need to assert function result multiple times.

Here is pseudocode:

<schema xmlns="http://purl.oclc.org/dsdl/schematron">
  <ns prefix="extension" uri="urn:extension" />

  <!-- declare abstract pattern -->
  <pattern abstract="true" id="abstract-pattern">
    <rule context="$context">
      <let name="someVariable" value="extension:function(@attribute, $externalParameter)" />
      <assert test="normalize-space($someVariable) = 'someValue1' ">
        error message
      </assert>
      <report test="normalize-space($someVariable) = 'someValue2' ">
        report message
      </report>
    </rule>
  </pattern>

  <!-- use abstract pattern -->
  <pattern is-a="abstract-pattern" id="concrete-pattern">
    <param name="$context" value="/*" />
    <param name="$externalParameter" value="999" />
  </pattern>
</schema>

The issue is that iso_abstract_expand.xsl does not substitute parameters for value attributes.

Please, consider this PR which fixes this behavior.

@tgraham-antenna tgraham-antenna added duplicate fix Solution for a bug or enhancement review wanted Needs review before acceptance labels Feb 29, 2020
@tgraham-antenna
Copy link
Member

Fixes same problem as #57.

Related issue: #5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate fix Solution for a bug or enhancement review wanted Needs review before acceptance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants