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

include/exclude filters as xs:string* #167

Closed
xml-project opened this issue Jul 21, 2019 · 4 comments

Comments

@xml-project
Copy link
Contributor

commented Jul 21, 2019

Last year we decided, that on p:directory-list (and other steps) we wanted to have include- and exclude-filters. And we made them xs:string*. At the point we decided this (if I remember right) we thought of filters as "globs". As globs could have whitespace as content, we voted against space separated list of filters but decided to go for xs:string* (each filter as one string in a sequence).

Later then we decided do abandon the idea of globs and went for regex, but kept xs:string*. As regex can not contain whitespace, I am not sure our decision against space separated entries should still hold.

Consider:

<p:directory-list href="something" include-filter=".*\.xpl .*\.xml" />

will most probably return an empty sequence, because I have to write

<p:directory-list path=".">
   <p:with-option name="include-filter" select="('.*\.xpl', '.*\.xml')"/>
 </p:directory-list>

go get all files ending with ".xpl" and ".xml". (Remember that an AVT will not solve the problem because AVTs always produce single strings, not sequence of strings).

Given this, I would like to be sure that we are still happy with xs:string*:
Perhaps a short survey could work.
👍 = keep xs:string*
👎 = go back to a space separated string.

@gimsieke

This comment has been minimized.

Copy link
Contributor

commented Jul 21, 2019

👍 since a regex may well contain whitespace

@Conal-Tuohy

This comment has been minimized.

Copy link

commented Jul 21, 2019

Personally, I think it's quite readable to just do the disjunction in the regular expression itself (effectively, use | as a separator rather than a space).

<p:directory-list href="something" include-filter=".*\.xpl|.*\.xml" />

or (semi-facetiously)

<p:directory-list href="something" include-filter=".*\.x(p|m)l" />
@ndw

This comment has been minimized.

Copy link
Collaborator

commented Jul 21, 2019

Yeah, I suppose @Conal-Tuohy is right. I think users will curse us everytime they write

<p:directory-list href="something" include-filter=".*\.xpl .*\.xml" />

and it doesn't do what they expect. But maybe they can learn to use | instead. That's certainly a huge improvement over forcing them to use the long form of the option.

@ndw

This comment has been minimized.

Copy link
Collaborator

commented Jul 24, 2019

I think we're done here.

@ndw ndw closed this Jul 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.