Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement let #2

Open
zikkandev opened this issue Oct 29, 2019 · 4 comments
Open

Implement let #2

zikkandev opened this issue Oct 29, 2019 · 4 comments

Comments

@zikkandev
Copy link

Hi,

Know that it's an old repo but would you consider implementing the let-element?

Regards,
Anders

@milo
Copy link
Owner

milo commented Oct 29, 2019

Hi,

never used that. I'll check the specification and let you know.

@Johan-Svensk
Copy link

Johan-Svensk commented Oct 31, 2019

Here's an example where it is used as a global variable (sorry about the formatting):

<schema xmlns="http://purl.oclc.org/dsdl/schematron">
 <ns uri="http://docbook.org/ns/docbook" prefix="db"/>
 <let name="globalVar" value="/db:article/descendant::db:keyword//@xml:id"/>
 <pattern id="Overview">
   <rule id="one" context="/db:article/db:section[@xml:id='overview']/db:section[@xml:id='product_info']">
      <assert test="$globalVar = 'x' or $globalVar = 'y'" role="error">"<value-of select="$globalVar"/>" is invalid</assert>
    </rule>
 </pattern>
</schema>

@milo
Copy link
Owner

milo commented Nov 13, 2019

Thanks for the example. I'll try to implement it next week.

@comp64 comp64 mentioned this issue Jul 21, 2020
@rahal
Copy link

rahal commented Dec 8, 2023

It's not a full support (it doesn't support global lets, but only lets inside a rule tag), but it's a start :
#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants