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

Reconsideration of the @[p:]... construct #554

Closed
eriksiegel opened this Issue Oct 11, 2018 · 14 comments

Comments

Projects
None yet
3 participants
@eriksiegel
Contributor

eriksiegel commented Oct 11, 2018

I'm trying to get my head around the concept that attributes, like use-when and expand-text are, dependent on the element they're occurring on, are in the p: namespace or not. And some, like p:timeout are always in the p: namespace...

In the specs there's also the depends attribute which is described (although not explicitly) as always not in the p: namespace.

I'm sure there was a reason for all this (I forgot but I remember talking about this to Norm), but it is a rule that rather complicates things for, probably?, an edge case.

Can't we simply decide that all standard attributes (and options) XProc introduces are in the p: namespace? I think future XProc users will be rather grateful for this simplification so they don't have to look up what type (always p:, no-namespace, dependent on element namespace) a standard attribute is.

@eriksiegel eriksiegel self-assigned this Oct 11, 2018

@ndw

This comment has been minimized.

Contributor

ndw commented Oct 11, 2018

The use-when and expand-text attributes have that varying namespace because you might want to put them on your own elements. In a p:inline for example.

The depends attribute doesn't need that because it only appears on steps.

I started writing this reply very opposed to putting them in the p: namespace, but then I thought about p:message and p:timeout and I wonder if we could tell an understandable story about some attributes always being in the p: namespace.

Mayyyybe.

@eriksiegel

This comment has been minimized.

Contributor

eriksiegel commented Oct 12, 2018

The use-when and expand-text attributes have that varying namespace because you might want to put them on your own elements. In a p:inline for example.

Hmm. So what? IMHO in a p:inline any attribute, except @p:inline-expand-text, has no special meaning. This is what we decided about @p:expand-text anyway, so why not about @use-when? Yes it might maybe, sometimes, be handy to use @use-when in a p:inline but it feels like a total edge case to me.

So, sorry Norm, I really don't see any strong reason to not have all XProc standard attributes in the p: namespace. Users will be grateful, I'm sure.

To prevent problems with options in the p: namespace (set by attribute), we might forbid that options use this namespace. That doesn't sound unreasonable does it? The p: namespace is reserved for things in XProc. The only place where you can use it for your own things is inside a p:inline.

@xml-project

This comment has been minimized.

Contributor

xml-project commented Oct 12, 2018

Not sure what to make of this discussion:

  1. To my understanding we have depends and p:depends. Although @ndw is right, that depends only can occur on specs, these steps do not need to be in XProc's namespace. I do not see any reason to forbid depends on user declared steps or processor extension steps. Is there a reason I missed?
  2. To my reading the same is true for use-when, isn't it?

I must say, that I are somewhat in favor of @eriksiegel 's proposal to put all standard attributes/options in XProc's namespace. Its just two letters more to type, but the off-shot is, that we have just ONE option/attribute and not two of each (one in the namespace and one without namespace.)

BTW: I think it is definitely an error, that users can declare options in XProc's namespace. We should fix this anyway.

@ndw

This comment has been minimized.

Contributor

ndw commented Oct 12, 2018

Is this a fair summary of the proposal? (I’m pulling a couple of threads together here to see if we can get consensus all at once.)

The following attributes are spelled “p:…” in call cases:

  • p:expand-text
  • p:use-when
  • p:depends
  • p:timeout
  • p:message
  • (Have I missed any?)

Am I the only one who doesn’t understand how users are supposed to know that it’s p:depends but psvi-required? That it’s p:timeout but exclude-inline-prefixes? What’s the rationale here?

But anyway. Assuming I’m in the minority here and we want to do this, can we simultaneously agree that p:message isn’t an option, it’s magic. (I may regret trying to conflate these two threads.)

@xml-project

This comment has been minimized.

Contributor

xml-project commented Oct 12, 2018

Am I the only one who doesn’t understand how users are supposed to know that it’s p:depends but psvi-required? That it’s p:timeout but exclude-inline-prefixes? What’s the rationale here?

Good point! We should keep that in mind!

can we simultaneously agree that p:message isn’t an option, it’s magic.

Yes. I think the discussion shows that we need magic here.

@ndw

This comment has been minimized.

Contributor

ndw commented Oct 15, 2018

So do we have consensus on #554 (comment) or are we still discussing this?

@xml-project

This comment has been minimized.

Contributor

xml-project commented Oct 15, 2018

Topic for Thursday's call?

@eriksiegel

This comment has been minimized.

Contributor

eriksiegel commented Oct 15, 2018

Am I the only one who doesn’t understand how users are supposed to know that it’s p:depends but psvi-required?

No, in retrospect your not the only one. Lets discuss Thursday.

@eriksiegel

This comment has been minimized.

Contributor

eriksiegel commented Oct 18, 2018

Might this make sense:

The reason the attributes mentioned above are in the p: namespace is because they can appear on step invocations. If they wouldn't be in the p: namespace you potentially clash with option-setting attributes.

p:timeout, p:depends and p:message are even specifically for step invocations and can't be used anywhere else (correct?). p:use-when and p:expand-text can be on any XProc element.

If this is true, what about the name attribute. I'm not all proposing to change it (please don't even think about it), but what happens if you also have an option called name and try to set this using an option-setting attribute?

@ndw

This comment has been minimized.

Contributor

ndw commented Oct 18, 2018

From 17.4.3.1:

Namespace qualified attributes on a step are extension attributes. Attributes, other than name, that are not namespace qualified are treated as a syntactic shortcut for specifying the value of an option.

@xml-project

This comment has been minimized.

Contributor

xml-project commented Oct 18, 2018

From 10.1.2:

The [p:]expand-text attribute can appear on all elements in the pipeline.

From 15.9:

Any element in the XProc namespace may have a use-when attribute [...] Elements that are not in the XProc namespace may also have a use-when attribute, but the attribute must be in the XProc namespace.

Conclusion:
[p:]expand-text and [p:]use-when can appear anywhere, not just on XProc elements.

@eriksiegel

This comment has been minimized.

Contributor

eriksiegel commented Oct 18, 2018

Hmm, shouldn't that be:

Namespace qualified attributes on a step that are not in the Xproc namespace and have not the same qualified name as an option on this step are extension attributes.

@eriksiegel eriksiegel removed their assignment Oct 18, 2018

@ndw

This comment has been minimized.

Contributor

ndw commented Oct 18, 2018

Per editor's call on 18 Oct 2018, we'll keep the current behavior. Attributes on p: elements do not require a namespace; on other elements, they do.

@ndw ndw self-assigned this Oct 18, 2018

@ndw

This comment has been minimized.

Contributor

ndw commented Oct 24, 2018

This item overtakes #29, I believe.

This was referenced Oct 24, 2018

@ndw ndw closed this in #577 Oct 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment