-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
docx-validator comments and fonts #9269
Comments
Ah, I saw how you modified the validator script. |
I've opened an upstream PR with an improved version of my script (it unpacks all files in word/ so I don't need an explicit list of files to validate): devoidfury/docx-validator#1 |
Oh, I already modified your script in parallel -- I will have to look at your changes to integrate them into mine. |
OK, I've updated my version of the script ( Mine has a few other enhancements: it can take multiple files on the command line, and it checks them all, outputting a list of non-valid files at the end, and returning the number of errors as exit status. |
So now we're up to 185 errors! |
"No matching global declaration available for the validation root." means there isn't actually a rule how to validate that XML, which is why I only extracted the files in the |
Try this, and then that number is down to 6! |
Oh, I missed that! Great. |
I also added |
Never mind, it turns out that the files in _rels are named .xml.rels, and when I enabled validation of them, I got the "no matching global declaration." So, I'll remove that change. |
annotationRef is not valid for `w:rPr`, only for `w:r` according to wml.xsd. See jgm#9269 Signed-off-by: Edwin Török <edwin@etorok.net>
annotationRef is not valid for `w:rPr`, only for `w:r` according to wml.xsd. See jgm#9269 Signed-off-by: Edwin Török <edwin@etorok.net>
annotationRef is not valid for `w:rPr`, only for `w:r` according to wml.xsd. See jgm#9269 Signed-off-by: Edwin Török <edwin@etorok.net>
The one about 'Ignorable' seems to be a false positive, that is something the markup processor should implement and is not normally part of the xsd it seems https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/mc-ignorable-attribute?view=netframeworkdesktop-4.8 and looks like wml.xsd got modified to accept it for document.xml, but not the others, this diff to wml.xsd makes it accept it for the others too: diff --git a/schemas/ISO-IEC29500-4_2016/wml.xsd b/schemas/ISO-IEC29500-4_2016/wml.xsd
index 6fa33d9..8b456f4 100644
--- a/schemas/ISO-IEC29500-4_2016/wml.xsd
+++ b/schemas/ISO-IEC29500-4_2016/wml.xsd
@@ -1816,6 +1816,7 @@
<xsd:attribute name="hAnsiTheme" type="ST_Theme"/>
<xsd:attribute name="eastAsiaTheme" type="ST_Theme"/>
<xsd:attribute name="cstheme" type="ST_Theme"/>
+
</xsd:complexType>
<xsd:group name="EG_RPrBase">
<xsd:choice>
@@ -3044,6 +3045,7 @@
<xsd:element name="targetScreenSz" type="CT_TargetScreenSz" minOccurs="0"/>
<xsd:element name="saveSmartTagsAsXml" type="CT_OnOff" minOccurs="0"/>
</xsd:sequence>
+ <xsd:attribute ref="mc:Ignorable" use="optional" />
</xsd:complexType>
<xsd:simpleType name="ST_FrameScrollbar">
<xsd:restriction base="xsd:string">
@@ -3194,6 +3196,7 @@
<xsd:element name="num" type="CT_Num" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="numIdMacAtCleanup" type="CT_DecimalNumber" minOccurs="0"/>
</xsd:sequence>
+ <xsd:attribute ref="mc:Ignorable" use="optional" />
</xsd:complexType>
<xsd:simpleType name="ST_TblStyleOverrideType">
<xsd:restriction base="xsd:string">
@@ -3285,6 +3288,7 @@
<xsd:element name="latentStyles" type="CT_LatentStyles" minOccurs="0" maxOccurs="1"/>
<xsd:element name="style" type="CT_Style" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
+ <xsd:attribute ref="mc:Ignorable" use="optional" />
And the comments are fixed by the linked PR. |
annotationRef is not valid for `w:rPr`, only for `w:r` according to wml.xsd. See #9269 Signed-off-by: Edwin Török <edwin@etorok.net>
It would be nice if we could get |
`make validate-docx-golden-tests` now passes Fixes jgm#9269 Signed-off-by: Edwin Török <edwin@etorok.net>
I pushed a workaround in the linked PR, the diff I pasted was probably truncated. Many thanks for your help in reviewing,fixing and merging these validation PRs. |
I upstreamed your changes to the validator, thanks! Also noted the issue with rels, I believe this is due to the definition commented out in |
Explain the problem.
These files fail validation with a modified docx-validator script that looks are more XML files:
pandoc/test/docx/golden/comments.docx
pandoc/test/docx/golden/custom_style_reference.docx
pandoc/test/docx/golden/track_changes_scrubbed_metadata.docx
Pandoc version?
Latest main.
The text was updated successfully, but these errors were encountered: