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

When does override-content-type apply? #174

Closed
ndw opened this issue Jul 25, 2019 · 6 comments

Comments

@ndw
Copy link
Collaborator

commented Jul 25, 2019

Consider this step:

<p:text-join suffix="Injected text." override-content-type="text/special">
  <p:with-input>
    <p:inline content-type="text/plain">Text</p:inline>
  </p:with-input>
</p:text-join>

The result port on p:text-join claims that it produces text/plain. But in this case it produces text/special. I think that should throw an error. (See also xproc/3.0-specification#854)

I think we could make the output content type text/* to avoid this. Or we could remove the output constraint and let text join produce anything at all.

@ndw

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 25, 2019

The error is err:XD0042 per Achim's clarification on xproc/3.0-specification#854.

@xml-project

This comment has been minimized.

Copy link
Contributor

commented Jul 25, 2019

I think text/* would be ok. But I am not sure I want XD0042 for, say:

<p:text-join suffix="Injected text." override-content-type="image/jpeg">
  <p:with-input>
    <p:inline content-type="text/plain">Text</p:inline>
  </p:with-input>
</p:text-join>

I would like to see a step error, saying that over-content-type is not compatible with "text/*".

@ndw

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 25, 2019

Come to think of it, do we really need override-content-type on p:text-join? We have p:cast-content-type to do this kind of thing and if we have it on p:text-join why not on all of the steps? Is there a specific text-related use case that I'm failing to remember?

@xml-project

This comment has been minimized.

Copy link
Contributor

commented Jul 25, 2019

I think @eriksiegel 's point was, that I might join text document all having say "text/csv" and I want the result to have this too.
This could be done by

<p:text-join /> <!-- producing text/plain as default -->
<p:cast-content-type /> <!-- change back to text/csv -->

Seems a bit odd, doesn't it?

@ndw

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 25, 2019

I suppose. I doubt it’s unique in that regard, but I won’t fuss.

I propose we change the output content type to text/*

@xml-project xml-project self-assigned this Jul 26, 2019

@xml-project

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

Fixed with pr #177

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