How access fieldmarks with API?

When I import .doc with form fields, I see ‘fieldmarks’ in my LibreOffice 4.2 instead of form fields.

    <field:fieldmark-start text:name="__Fieldmark__0_2026164759" field:type="vnd.oasis.opendocument.field.FORMTEXT">
    <field:param field:name="Description" field:value=""/>
    <field:param field:name="Name" field:value="Field1"/>
    </field:fieldmark-start>Field1<field:fieldmark-end/>

For example, in OpenOffice I get input fields and access them through getTextFields.createEnumeration.

Well, now I need to access fieldmark by name, get it range, delete it.
There is no any documentaion in sdk.
Neither getBookmarks nor getTextFields give me this fields.

How can I find them?

I cannot allow my program’s users to install LibreOffice instead of OpenOffice due to this problem.

Please edit your question to more clearly indicate what a “fieldmark” is i.e., what is the underlying XML? If you can link to a screenshot or example document that includes an example of the type of “fieldmark” you wish to delete, that would be even better. Thanks.

By enumerating the document’s text, it is possible to find the appropriate text portions and get the bookmarks. See python - Enumerate FieldMarks in a libreoffice document - Stack Overflow.

I am going to have a go at answering your query, based on the currently provided information. I asked a similar question a couple of years ago in relation to deleting fields in Word-produced DOC files that contained EndNote citation fields:

<field:fieldmark-start text:name="__Fieldmark__9119_405037922" field:type=""/>
    Highlighted field text
<field:fieldmark-end/>

It is worth noting that there is no field:fieldmark... element in either the ODF v1.2 or OOXML 3rd ed., 2012 specification. Instead, these XML entries are currently created by Writer as a workaround to cater for input fields (and possibly other unsupported fields). OASIS issue OFFICE-2096 is the related proposal to fully support these fieldmarks[1]. Bugs fdo#43569 and fdo#45341 are related, in terms of input fields not being editable when saved to the DOC format (as they are effectively an as-yet-unsupported feature).

The class reference for sw::mark::Fieldmark may be of some use in determining how these elements are accessed via the UNO API.

[1] ODF v1.3 will likely support the field:fieldmark, field:fieldmark-start, and field:fieldmark-end elements.

Thank you for your answer.
I’m still researching behaviour of LO with fieldmarks.
There is some info: fdo#30711

Way to create fieldmark:

FM = createInstance("com.sun.star.text.Fieldmark")
getText.InsertTextContent(cursor, FM, True)

I have not found yet way to name it and display in editor.
I have not found yet way to find it in text and make changes.

And if I cannot delete simple input field, I am pessimistic about fieldmark…

Yes, the implementation at present appears to be only partial. I had a read through fdo#30711 before posting my answer, but I was not sure it contained enough detail to be useful. I’m not sure if XMLTextMarkImportContext_8cxx_source.html contains any useful detail. It does seem to indicate though that the fieldmark implementation (at least in the import filter) is not complete.