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

Validate option attributes or not? #948

Closed
xatapult opened this issue Mar 2, 2020 · 5 comments
Closed

Validate option attributes or not? #948

xatapult opened this issue Mar 2, 2020 · 5 comments

Comments

@xatapult
Copy link
Contributor

@xatapult xatapult commented Mar 2, 2020

When I validate an XProc 3.0 pipeline it says my pipeline is invalid when I write something like this:

<p:directory-list detailed="{$detailed}"> ...

The message is: value of attribute "detailed" is invalid; must be a boolean

Well... yes and no.

Given that very complex things can happen using AVTs in option attributes, maybe we should not validate their contents at all?

Opinions please.

@gimsieke

This comment has been minimized.

Copy link
Contributor

@gimsieke gimsieke commented Mar 2, 2020

Let’s get rid of AVTs. I didn’t like the idea in the first place, anyway.

@xatapult

This comment has been minimized.

Copy link
Contributor Author

@xatapult xatapult commented Mar 2, 2020

LOL

The resolution is I suppose simple: Make sure that in the schema all option attributes have the type xs:string or something like that.

@gimsieke

This comment has been minimized.

Copy link
Contributor

@gimsieke gimsieke commented Mar 2, 2020

Seriously, one option is not to specify the type as boolean but as a regex like '(\{.+\}|true|false)' (in RNG, patterns are automatically anchored), but then <p:directory-list detailed="{$t}rue"> will be flagged as invalid. Or we can accept any string.

We might leave the current RNC or RNG as it is and generate these more liberal patterns.

@ndw

This comment has been minimized.

Copy link
Contributor

@ndw ndw commented Mar 2, 2020

Sounds like a schema bug, one way or another.

I created xproc/3.0-grammar#5 to track this.

@xatapult

This comment has been minimized.

Copy link
Contributor Author

@xatapult xatapult commented Mar 3, 2020

Ok, then we can close this one.

@xatapult xatapult closed this Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.