Page 1 of 1

FootnoteRef missing id property

PostPosted: Thu Nov 22, 2012 6:46 am
by kjohns3
I'm using the CommentsSample.class as a reference point to develop logic to add footnotes to a document.

All is well, except the FootnoteRef class is missing the id property.

I created a test document by hand with a footnote and it expects an id attribute.
<w:footnoteReference w:id="1"/>

Is this an oversight, or am I missing the obvious?

For reference, I'm using docx4j 2.8.1.

Thanks,
Ken

Re: FootnoteRef missing id property

PostPosted: Thu Nov 22, 2012 7:22 am
by jason
I think the class you want is CTFtnEdnRef, which has:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
    public void setId(BigInteger value) {
        this.id = value;
    }
 
Parsed in 0.014 seconds, using GeSHi 1.0.8.4


Create it via ObjectFactory:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
    @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", name = "footnoteReference", scope = R.class)
    public JAXBElement<CTFtnEdnRef> createRFootnoteReference(CTFtnEdnRef value) {
        return new JAXBElement<CTFtnEdnRef>(_RFootnoteReference_QNAME, CTFtnEdnRef.class, R.class, value);
    }
 
Parsed in 0.014 seconds, using GeSHi 1.0.8.4

Re: FootnoteRef missing id property

PostPosted: Thu Nov 22, 2012 7:31 am
by kjohns3
Yep, that's what I was missing. Thanks!