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:cast-content-type needs an update #373

Open
xml-project opened this Issue Apr 22, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@xml-project
Contributor

xml-project commented Apr 22, 2018

I think we should take a closer look at p:cast-content-type, because it seems to be somewhat outdated by the development of XProc 3.0. Some of my thoughts:

  1. In Prague we agreed that a text document is a text node surrounded by a document node. Since all encoding problems are solved when the text document is created, I think we no longer need a base64 encoding when casting a text document to an XML-document.
  2. Since we define the loading of a JSON document via fn:parse-json(), it seems natural to me to use the inverse function fn:serialize(., map{"method":"json"}) when a JSON document is casted to a text document.
  3. XPath 3.1 defines fn:json-to-xml() which converts a JSON text to an XML-document. It is imho therefore obvious to say, that casting a JSON-document to an XML-document is done via fn:json-to-xml(fn:serialize(., map{"method":"json"})).
  4. Casting an XML-document to a text document seems to be definable via fn:serialize(.).
  5. At least for some XML-documents XPath 3.1 defines a conversion to JSON in fn:xml-to-json(). We could use this to define casting from (some) XML-documents to a JSON documents via: fn:parse-json(fn:xml-to-json()).
@eriksiegel

This comment has been minimized.

Show comment
Hide comment
@eriksiegel

eriksiegel Apr 22, 2018

Contributor

??? There is no p:cast-content-type anywhere in the specification. Its probably me but I've never heard of it.

Contributor

eriksiegel commented Apr 22, 2018

??? There is no p:cast-content-type anywhere in the specification. Its probably me but I've never heard of it.

@xml-project

This comment has been minimized.

Show comment
Hide comment
@xml-project

xml-project Apr 22, 2018

Contributor

Sorry, but I have to "????" also. If you follow the link in the first line, your will find the step's signature in the standard step library.

Contributor

xml-project commented Apr 22, 2018

Sorry, but I have to "????" also. If you follow the link in the first line, your will find the step's signature in the standard step library.

@eriksiegel

This comment has been minimized.

Show comment
Hide comment
@eriksiegel

eriksiegel Apr 23, 2018

Contributor

Ah, sorry, sorry. I was looking in the main spec document. My fault.

Contributor

eriksiegel commented Apr 23, 2018

Ah, sorry, sorry. I was looking in the main spec document. My fault.

@ndw

This comment has been minimized.

Show comment
Hide comment
@ndw

ndw May 4, 2018

Contributor

There's the implementation defined behavior to consider though: casting SVG to PNG, or something even crazier.

Contributor

ndw commented May 4, 2018

There's the implementation defined behavior to consider though: casting SVG to PNG, or something even crazier.

@ndw

This comment has been minimized.

Show comment
Hide comment
@ndw

ndw Sep 6, 2018

Contributor
  • The xml-to-json and json-to-xml conversions must support the XPath 3.1 functions
  • The parameters are used for this conversion
  • An implementation can use additional (namespaced) options to control the behavior
  • The conversion must work for JSON not just text and string JSON text
  • This step could normalize RDF as well

Word this as "you must unless".

Contributor

ndw commented Sep 6, 2018

  • The xml-to-json and json-to-xml conversions must support the XPath 3.1 functions
  • The parameters are used for this conversion
  • An implementation can use additional (namespaced) options to control the behavior
  • The conversion must work for JSON not just text and string JSON text
  • This step could normalize RDF as well

Word this as "you must unless".

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