Bug 66085 - org.openxmlformats.schemas.wordprocessingml.x2006.main.STHint missing ENUM value
Summary: org.openxmlformats.schemas.wordprocessingml.x2006.main.STHint missing ENUM value
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2022-05-24 02:39 UTC by Chris Lake
Modified: 2022-05-25 01:35 UTC (History)
0 users

Failing Word Doc (15.31 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-05-24 02:39 UTC, Chris Lake

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lake 2022-05-24 02:39:14 UTC
Created attachment 38302 [details]
Failing Word Doc


I'm not sure this is strictly the correct place to log this, but I don't know where else to go.

We are currently attempting an upgrade of POI from v4.1.2 to v5.2.2. In this we note in your release notes that this includes an update in conformance to the ECMA-376 fifth edition spec. With the updated libraries, running the attached Word Document we received an unexpected error:

string value 'cs' is not a valid enumeration value for ST_Hint in namespace http://schemas.openxmlformats.org/wordprocessingml/2006/main.
  org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: string value 'cs' is not a valid enumeration value for ST_Hint in namespace http://schemas.openxmlformats.org/wordprocessingml/2006/main

Having investigated this, I see that it's not really a problem with POI per se. According to the PDF of the spec:
  Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf
    - 17.18.41 ST_Hint (Font Type Hint) p.1396 (page 1406)
      cs (Complex Script Font) is mentioned as a possible value
    - A.1 WordprocessingML p.3841 (page 3851)
      Line 1715 of the XSD shows 'cs' as a possible value.

However, in the actual XSD used to generate the XMLBeans classes:
    - OfficeOpenXML-XMLSchema-Transitional.zip
      - wml.xsd
        Line 1789 of the XSD there is no STHint.CS ENUM and thus no ENUM in the code generated by XMLBeans.

So I can see that the POI classes are simply conforming to the XSD via XMLBeans generation. For now we can work around this fact, but is this something you guys are able to modify/fix as part of your processes?
Comment 1 PJ Fanning 2022-05-24 08:58:47 UTC
I just downloaded latest files from https://www.ecma-international.org/publications-and-standards/standards/ecma-376/ and the ST_Hint does not list "cs". We should not hand modify the files to try to correct any issues.
Could you report the missing value to Microsoft and when they publish a corrected version, we can uptake it.
Comment 2 Chris Lake 2022-05-24 11:53:32 UTC
Would you happen to know where to report it to MS?
Comment 3 PJ Fanning 2022-05-24 12:06:49 UTC
No - for numerous reasons, Apache keep well clear of Microsoft. We only deal with stuff that is publicly released.
Comment 4 Nick Burch 2022-05-24 12:45:41 UTC
Based on https://docs.microsoft.com/en-us/openspecs/main/ms-openspeclp/3589baea-5b22-48f2-9d43-f5bea4960ddb I think you need to report it in their specifications forum. 

(There also used to be a way to raise a support ticket, but I think that has now gone)
Comment 5 Chris Lake 2022-05-25 01:35:20 UTC
Just in case anyone else comes across this issue: