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

Rendition of record definitions in F&O spec #1527

Open
michaelhkay opened this issue Oct 23, 2024 · 3 comments
Open

Rendition of record definitions in F&O spec #1527

michaelhkay opened this issue Oct 23, 2024 · 3 comments
Labels
Build Affects the build infrastructure only Editorial Minor typos, wording clarifications, example fixes, etc.

Comments

@michaelhkay
Copy link
Contributor

We're making progress here but there are still things that need fixing.

Currently a record definition like uri-structure-record is expanded:

(a) into a full definition (with explanations of all the fields) at the point where a PI of the form <?record-description uri-structure-record?>appears. This may be either within a specific function entry in the function catalog, or in the narrative prose of xpath-functions.xml.

(b) into a concise definition (without explanations of fields) at the point where the type is referenced in a function signature.

A hyperlink to the record definition is created (i) where the type name appears in a function signature, and (ii) manually, using the generic link format <loc href="#uri-structure-record">uri-structure-record</loc>. However, the target of the link is the first concise definition (see (b) above) rather than the full definition.

There are also some limitations in the rendering of the definitions. The full definition does not indicate which fields are optional/required, though this information is available in the XML. Neither the full nor the concise definition appears to indicate whether the record is extensible.

@michaelhkay michaelhkay added Editorial Minor typos, wording clarifications, example fixes, etc. Build Affects the build infrastructure only labels Oct 23, 2024
@michaelhkay
Copy link
Contributor Author

michaelhkay commented Oct 23, 2024

I would suggest that the full record definition be handled in a similar way to function definitions. It should always be in a dedicated section, indicated in a similar way to functions:

<div3 id="rec-uri-structure-record">
      <head><?record-definition uri-structure-record?></head>
</div3>

and hyperlinks should direct to this section using a generated specref link.

@ndw
Copy link
Contributor

ndw commented Oct 23, 2024

👍

@michaelhkay
Copy link
Contributor Author

I think there is a technical issue here as well as a presentation issue. Record types defined in the F&O spec should have names that are in the fn namespace, to avoid any confusion with user-defined record type names.

(Aside: The recently-introduced type schema-type-record is a recursive record type, which creates complications for the subtyping rules; in fact I found that in the Saxon implementation, which computes hashcodes of types for internal purposes, the computation of the hashcode is non-terminating because of the recursive definition, and solving this requires paying attention to the distinction between iso-recursive and equi-recursive types in section 3.3.2.11 of the spec. This relies on using record type names as unique identifiers in a way that Saxon does not yet implement.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Affects the build infrastructure only Editorial Minor typos, wording clarifications, example fixes, etc.
Projects
None yet
Development

No branches or pull requests

2 participants