On 3/3/15 2:26 PM, Vaidheeswaran C wrote:
On Tuesday 03 March 2015 08:41 PM, Monroe, Will wrote:
Hello,
I'm trying to troubleshoot a corrupt ODT file that I've exported from org-mode.
The org-mode manual provides some guidance for this process on the "Validating
OpenDocument XML" page (see
http://orgmode.org/manual/Validating-OpenDocument-XML.html#Validating-OpenDocument-XML).
It mentions validation of an ODT document against the "OpenDocument RELAX NG
Compact Syntax (RNC) schema". I have obtained the xml and RNC files from the
org-mode Github site but I'm unsure how to use them. The org-mode manual page
mentions general help in the Introduction (see
http://orgmode.org/nxml-mode/Introduction.html#Introduction) but I get a 404
error when I attempt to load the page.
Does anyone know where I can read this guide?
You can avoid the cross-manual link errors, by using the manuals at
gnu.org site:
https://www.gnu.org/software/emacs/manual/html_node/org/Validating-OpenDocument-XML.html
For verification, this is roughly what you need to do:
1. Copy over schema file.
2. Reload Emacs.
3. C-x C-f file.odt
4. Press ENTER on content.xml
5. C-c C-n (M-x rng-next-error)
Or
You can try an online validator:http://odf-validator.rhcloud.com/
Based on my own experience, your *.org file is NOT in utf-8 and uses
non-English characters (whatever they are called). Just switch the
file to utf-8 encoding and you will be all set.
Hello,
Thanks for your reply. I checked the text formatting of the .org document and
it was utf-8 (confirmed by Emacs "U" in the modeline). I also tried exporting
it again and looking at the Messages--can't believe I didn't do that to begin
with--and I saw this:
,----
| LaTeX to MathML converter not available.
| Formatting LaTeX using verbatim
| Embedding /Users/wmonro1/Dropbox/org/panopto-create-recording.png as
Images/0001.png...
| Wrote /var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/meta.xml
| Using schema ~/Dropbox/emacs/org-odt-schema/schema/od-schema-v1.2-os.rnc [2
times]
| Saving file
/var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/styles.xml...
| Wrote
/var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/.styles.xml.~undo-tree~
| Wrote /var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/styles.xml
| Using vacuous schema
| Wrote /var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/mimetype
| Using vacuous schema
| Saving file
/var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/META-INF/manifest.xml...
| Wrote
/var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/META-INF/.manifest.xml.~undo-tree~
| Wrote
/var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/META-INF/manifest.xml
| Saving file
/var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/content.xml...
| Wrote
/var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/.content.xml.~undo-tree~
| Wrote
/var/folders/_r/333b9wt92kncthm2ph8wpp59b0ccdd/T/odt-66242t3k/content.xml
| (No changes need to be saved)
| Creating ODT file...
| Running zip -mX0 work.odt mimetype
| Running zip -rmTq work.odt .
| Created /Users/wmonro1/Dropbox/org/work.odt
| Parsing archive file...done.
| Running open /Users/wmonro1/Dropbox/org/work.odt...done
| Parsing archive file...done.
`----
The presence of the /.content.xml.~undo-tree~, /.manifest.xml.~undo-tree~, and
/.styles.xml.~undo-tree~ got my attention. After submitting the document to the
online validator (default settings used), these files, undoubtedly created by my
personal inspection in Emacs, showed up again:
,----
| Details:
| work.odt: Info: ODF version of root document: 1.2
| work.odt/META-INF/manifest.xml: Error: The file '.content.xml.~undo-tree~'
shall be listed in the 'META-INF/manifest.xml' file as it exists in the ODF
package 'work.odt'!
| work.odt/META-INF/manifest.xml: Error: The file '.styles.xml.~undo-tree~'
shall be listed in the 'META-INF/manifest.xml' file as it exists in the ODF
package 'work.odt'!
| work.odt/META-INF/manifest.xml: Error: The file
'META-INF/.manifest.xml.~undo-tree~' shall be listed in the
'META-INF/manifest.xml' file as it exists in the ODF package 'work.odt'!
| work.odt/META-INF/manifest.xml: Warning: The directory 'Images/' is not a
sub-document and should not be listed in the 'META-INF/manifest.xml' file of ODF
package 'work.odt'!
| internal:/schema/odf1.2/OpenDocument-v1.2-cos01-manifest-schema.rng: Info:
parsed.
| work.odt/META-INF/manifest.xml: Info: 3 errors, 1 warnings
| work.odt/mimetype: Info: no errors, no warnings
| work.odt: Info: Media Type: application/vnd.oasis.opendocument.text
| internal:/schema/odf1.2/OpenDocument-v1.2-cos01-schema.rng: Info: parsed.
| work.odt/meta.xml: Info: Generator:
| work.odt/meta.xml: Info: no errors, no warnings
| work.odt/styles.xml[2,6289]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,7187]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,7885]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,15357]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,16222]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,25655]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,26198]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,26482]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,27530]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,28689]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,29340]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,34718]: Error: unexpected attribute
"loext:contextual-spacing"
| work.odt/styles.xml[2,43716]: Error: unexpected attribute
"loext:rel-width-rel"
| work.odt/styles.xml: Info: 13 errors, no warnings
| work.odt/content.xml: Info: no errors, no warnings
| internal:/schema/odf1.2/OpenDocument-v1.2-cos01-dsig-schema.rng: Info: parsed.
| work.odt: Info: 16 errors, 1 warnings
`----
So my best guess is that I need to remove ~undo-tree files to generate an ODT
file that is valid. Although I'm at a loss as to where these files might be.
I've checked in .emacs.d/elpa/org, where my org-mode is installed and in the
default `org-odt-data-dir' that I set.
Am I on the right track? If so, is there another place where the style files
might reside?
Will