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

First sketch on p:cast-content-type #285

Merged
merged 3 commits into from Dec 20, 2019
Merged

Conversation

@xml-project
Copy link
Contributor

xml-project commented Dec 14, 2019

This is a first sketch for the revised "p:cast-content-type" (see #16). I tried to include @ndw's proposal to parse and serialize e.g. xml->text and vice versa. Also I try to come up for document property "serialization" which was not covered yet.
I do not expect an approve yet, but propose to discuss this on next editors call.

@xml-project xml-project requested review from gimsieke, ndw and xatapult Dec 14, 2019
Copy link
Contributor

gimsieke left a comment

Sorry I was interrupted yesterday before submitting three minor corrections

is <glossterm>implementation–defined</glossterm>.</impl>
If the input document is an XML representation of JSON as defined in
<biblioref linkend="xpath31-functions"/>,
implementations <rfc2119>must</rfc2119> use <function>fn:xml-to-json</function>

This comment has been minimized.

Copy link
@gimsieke

gimsieke Dec 15, 2019

Contributor

The result type of xml-to-json() is xs:string. Do we need to say that the result document is an XProc JSON document that represents the resulting JSON string, that is, a map with a content type?

This comment has been minimized.

Copy link
@xml-project

xml-project Dec 15, 2019

Author Contributor

Right. I think we should say, that fn:parse-json(p:xml-to-json()) is used. Sorry, I did not check this.

<title>Casting from an HTML media type</title>
<itemizedlist>
<listitem>
<para>Casting from an HTML media type to a XML media type changes

This comment has been minimized.

Copy link
@gimsieke

gimsieke Dec 15, 2019

Contributor

to an XML

a well-formed XML document</error>. The serialization property is removed.</para>
</listitem>
<listitem>
<para>Casting from a text media type to an HTML media type parsed the text value

This comment has been minimized.

Copy link
@gimsieke

gimsieke Dec 15, 2019

Contributor

parses

<listitem>
<para>Casting from an HTML media type to another HTML media type
changes “<literal>content-type</literal>” document property.</para>
</listitem>

This comment has been minimized.

Copy link
@ndw

ndw Dec 19, 2019

Collaborator

What media types, other than text/html are HTML media types?

This comment has been minimized.

Copy link
@xml-project

xml-project Dec 19, 2019

Author Contributor

[Definition: The “text/html” and “application/xhtml+xml” media types are HTML media types. ]

<p:option name="content-type" required="true" as="xs:string"/>
<p:option name="parameters" as="map(xs:QName,item()*)?"/>
</p:declare-step>

This comment has been minimized.

Copy link
@ndw

ndw Dec 19, 2019

Collaborator

Should we note explicitly somewhere that this step does nothing if the content type requested is the same as the content type received?

This comment has been minimized.

Copy link
@xml-project

xml-project Dec 19, 2019

Author Contributor

Yes, may be that is a good idea in case people wonder.

@ndw

This comment has been minimized.

Copy link
Collaborator

ndw commented Dec 19, 2019

Agreed. Achim to merge this PR after minor editorial changes.

@xml-project xml-project requested review from gimsieke and ndw and removed request for gimsieke and xatapult Dec 19, 2019
@xml-project

This comment has been minimized.

Copy link
Contributor Author

xml-project commented Dec 19, 2019

@ndw Would you mind to check the new first para and give me a go, if everything is all right.

@@ -6,7 +6,9 @@
<title>p:cast-content-type</title>

<para>The <tag>p:cast-content-type</tag> step creates a new document by
changing the media type of its input.</para>
changing the media type of its input. If the value of <option>content-type</option>

This comment has been minimized.

Copy link
@ndw

ndw Dec 19, 2019

Collaborator

... If the value of the content-type...

@ndw

This comment has been minimized.

Copy link
Collaborator

ndw commented Dec 19, 2019

Proposed a fix for one grammatical, otherwise it's fine.

@xml-project xml-project merged commit 23db3ee into xproc:master Dec 20, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@xml-project xml-project deleted the xml-project:fix-cct branch Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.