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

How to generate references ? #31

Open
davyrouillard opened this issue May 12, 2016 · 2 comments
Open

How to generate references ? #31

davyrouillard opened this issue May 12, 2016 · 2 comments

Comments

@davyrouillard
Copy link

davyrouillard commented May 12, 2016

Dears Contributors,

First, thanks you for this very useful library. However, I have a problem to generate references in ODT document using ReferenceRef (see attached file). I use the following code to produce it :

    p.addElement(ReferenceRef(referenceformat="text", refname="[MYREF]"))

And the result is:
<text:p>Add a reference to <text:reference-ref ns41:e="text" ns41:e="[MYREF]"/></text:p>

Where I expect to obtain:
<text:p>Add a reference to <text:reference-ref refefernce-format="text" refname="[MYREF]"/></text:p>

What's wrong ?

Thanks you
Davy
test_references.txt

@davyrouillard davyrouillard changed the title How generate references ? How to generate references ? May 12, 2016
@davyrouillard
Copy link
Author

davyrouillard commented Jun 16, 2016

Dears Contributors,
The reason seems to be that the attributes referenceformatand refname are not allowed in the odfpy grammar.
However the opendocument v1.2 specification allows these attributes (see
https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415444_253892949 )

Therefore, I have had the following lines in grammar.py :

# allowed_attributes
    (TEXTNS,u'reference-ref'):(
        (TEXTNS,u'ref-name'),
        (TEXTNS,u'reference-format'),
    ),

And all work perfecly.

Davy

@davyrouillard
Copy link
Author

Sorry, I have closed the issue by mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant