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

How to identify a text document only on a port #747

Closed
eriksiegel opened this Issue Feb 7, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@eriksiegel
Copy link
Contributor

eriksiegel commented Feb 7, 2019

In updating the text steps I stumbled on this problem:

What would be an appropriate value for @content-types on a port declaration that specifies that only text documents can flow in or out.

If I specify content-types="text/*" this also includes text/xml which is not a text document. But content-types="text/plain" seems too restrictive to me... Anybody any advice?

@ndw

This comment has been minimized.

Copy link
Contributor

ndw commented Feb 7, 2019

Using text/xml is a bad idea. I thought it was actually deprecated, but it turns out that by the time RFC 7303 came out that wasn't actually necessary (because of changes in the underlying text media type specifications).

I don't think we can do better than text/* for media types on ports, unfortunately.

We could say that text/* is interpreted by XProc as meaning any text media type except text/xml. We already note that distinction somewhere in the spec. But I don't know if that's worth it.

@Conal-Tuohy

This comment has been minimized.

Copy link

Conal-Tuohy commented Feb 7, 2019

text/xml is a sad legacy, but unfortunately it's pretty standard and is even the default media type for XSLT output I believe.

@eriksiegel

This comment has been minimized.

Copy link
Contributor Author

eriksiegel commented Feb 7, 2019

All right, I'll stick to text/*

@eriksiegel eriksiegel closed this Feb 7, 2019

@Conal-Tuohy

This comment has been minimized.

Copy link

Conal-Tuohy commented Feb 7, 2019

I haven't been following the spec development closely enough, so this may be a dumb idea, but could it help to add another kind of "document type" (other than the IANA media type) analogously to the XSLT/XQuery serialisation methodparameter? i.e. with values "text", "xml", "json", etc? If this option were explicitly part of the port declaration as well as in the metadata associated with each document it could resolve the ambiguity here (you could declare the port to have document-type="text" and it would not even need a content-type necessarily) and also usefully provide default values to p:store steps.

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