pdf-issues icon indicating copy to clipboard operation
pdf-issues copied to clipboard

/Link allows /Formula as a child, but /Reference does not.

Open faceless2 opened this issue 1 year ago • 7 comments

A recent MathML examples from David had this sample

<math>
  <mfrac>
    <mrow id="numerator">
      <mi>x</mi><mo>+</mo>
      <mtext style="display:inline">
        <b>bold </b> <a href="#denominator">link to <math><mi>x</mi></math></a>
      </mtext>
    </mrow>
    <mrow id="denominator">
      <mi>y</mi><mo>+</mo>
      <mtext style="display:inline">
        <i>italic </i> <a href="#numerator">link to <math><mi>y</mi></math></a>
      </mtext>
    </mrow>
  </mfrac>
</math>

When converting to PDF/UA-2 the <a href='#denominator'> is tagged using a /Reference, because in PDF/UA-2 9.2.5.20:

the Reference structure type should be used for intra-document targets

However this leads to invalid content because /Formula is not a valid child of /Reference according to ISO32005.

It is a valid child in /Link, which means - according to the above suggestion - if the href had not been an intra-document target, it would have been valid. /Reference can also contain /Figure.

I'm pretty sure this isn't intentional. Suggestion: Add /Formula as an allowed child of /Reference

faceless2 avatar Nov 04 '24 16:11 faceless2

shouldn't the title say Formula instead of Figure?

u-fischer avatar Nov 04 '24 17:11 u-fischer

@u-fischer Thank you, fixed.

faceless2 avatar Nov 04 '24 22:11 faceless2

Proposed Solution: Resolve the Reference child relationships to match Link (Matthew to check if there's anything that would not make sense). Reuse TWG agrees.

32005

mrbhardy avatar Nov 05 '24 08:11 mrbhardy

May I ask what is the proposed solution exactly here? (trying to see necessary changes in a validator)

The proposed solution seems to indicate that the allowed children of Link and Reference should be the same (which makes sense) but currently Reference allows Link but not Reference and Link allows Reference but not Link.

Is the proposal that the content models are the same except that Reference allows Link and Link allows Reference, or is the proposal that they share a content model and both allow nesting of both, or that neither is allowed to be nested in either?

Reference
    0..n NonStruct
    0..n Private
    0..n Note
    0..n Lbl
    0..n Em
    0..n Strong
    0..n Span
    0..n Link
    0..n Annot
    0..n FENote
    0..n BibEntry
    0..n Figure
    0..n Artifact
    0..n content item

Link
    ∅* DocumentFragment
    ∅* Part
    0..n Art
    0..n Div
    0..n Sect
    ∅* Aside
    ∅* BlockQuote
    0..n NonStruct
    0..n Private
    ∅* P
    0..n Note
    0..n Code
    ∅* Hn
    ∅* H
    ∅* Title
    0..n Sub
    0..n Lbl
    0..n Em
    0..n Strong
    0..n Span
    0..n Quote
    0..n Reference
    0..n Annot
    ∅* Form
    0..n Ruby
    0..n Warichu
    0..n FENote
    ∅* L
    0..n BibEntry
    ∅* Table
    ∅* Caption
    0..n Figure
    0..n Formula
    0..n Artifact
    0..n content item

davidcarlisle avatar Feb 04 '25 12:02 davidcarlisle

Just a note that: David’s question needs an answer; Any “proposed solution” should be applied NOW!

car222222 avatar Apr 21 '25 03:04 car222222

This got assigned to Duff, but I sm unsure why!

car222222 avatar Apr 21 '25 03:04 car222222

We discussed this in the last TWG meeting, because it was a comment on the last draft. We agreed to the change. The proposal was to match the containment for each and allow link and reference.

mrbhardy avatar Apr 21 '25 03:04 mrbhardy

Did this get changed, at least in the table in Clause 5 of 32005?

car222222 avatar Jun 12 '25 10:06 car222222

Yes, already fixed in the latest 32005 (you can check this yourself @car222222, since it was shared to the reuse group).

mrbhardy avatar Jun 13 '25 04:06 mrbhardy