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

p:data with text/plain #154

Closed
alexmilowski opened this issue May 11, 2014 · 8 comments
Closed

p:data with text/plain #154

alexmilowski opened this issue May 11, 2014 · 8 comments
Labels

Comments

@alexmilowski
Copy link

@alexmilowski alexmilowski commented May 11, 2014

Starting with version 1.0.17, the following:

<p:data wrapper="c:query" href="query.xq" content-type="text/plain"/>

returns base64 encoded content instead of text:

<c:query xmlns:c="http://www.w3.org/ns/xproc-step" c:content-type="application/octet-stream" c:encoding="base64">ZGVjbGFyZSBuYW1lc3BhY2Ugcz0iaHR0cDovL3dlYXRoZXIubWlsb3dza2kuY29tL1YvQVBSUy8i...

@alexmilowski
Copy link
Author

@alexmilowski alexmilowski commented May 13, 2014

The pipeline:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
    xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0"
   >

<p:output port="result" primary="true"/>

<p:identity>
<p:input port="source">
<p:data wrapper="c:data" content-type="text/plain" href="foo.xq"/>
</p:input>
</p:identity>

</p:declare-step>
@alexmilowski
Copy link
Author

@alexmilowski alexmilowski commented May 13, 2014

The referenced file 'foo.xq':

element p { "hello world! }
@alexmilowski
Copy link
Author

@alexmilowski alexmilowski commented May 13, 2014

Expected output:

<c:data xmlns:c="http://www.w3.org/ns/xproc-step" content-type="text/plain">element p { "hello world! }
</c:data>
@alexmilowski
Copy link
Author

@alexmilowski alexmilowski commented May 13, 2014

The result in both 1.0.17-95 and 1.0.18-95:

<c:data xmlns:c="http://www.w3.org/ns/xproc-step" content-type="application/octet-stream" encoding="base64">ZWxlbWVudCBwIHsgImhlbGxvIHdvcmxkISB9Cg==
</c:data>
@alexmilowski alexmilowski changed the title c:data with text/plain p:data with text/plain May 13, 2014
@phtyson
Copy link

@phtyson phtyson commented Jul 28, 2014

I found that if the href value ends in '.txt' it will produce text/plain content; otherwise base64. Using 1.0.18-95.

@alexmilowski
Copy link
Author

@alexmilowski alexmilowski commented Aug 7, 2014

Huh. Extensions should not be used to guess the media type when I explicitly give the media type of the referenced URI.

ndw added a commit that referenced this issue Aug 15, 2014
@ndw
Copy link
Owner

@ndw ndw commented Aug 15, 2014

I think this is fixed.

@ndw ndw added the test label Aug 18, 2014
@ndw
Copy link
Owner

@ndw ndw commented Aug 26, 2014

I believe this is fixed in XML Calabash 1.0.19, released today.

@ndw ndw closed this Aug 26, 2014
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.