I’m investigating the use of the attribute xml:id in ODT files (*).
Grepping some samples I see
<text:p xml:id="id3893364801" text:style-name="New_20_Chapter"><draw:frame draw:style-name="fr3" draw:name="LibreOffice Logo" text:anchor-type="as-char" svg:width="12.959cm" svg:height="3.318cm" draw:z-index="2"><draw:image draw:mime-type="image/png">
<text:p xml:id="id3179432551" text:style-name="Guide_20_Name"><text:user-defined style:data-style-name="N0" text:name="Guide Name">Calc Guide</text:user-defined><text:s/><text:user-defined style:data-style-name="N0" text:name="LibreOffice Version">7.6</text:user-defined></text:p>
<text:list xml:id="list475153334" text:style-name="Heading_20_Note">
<text:list xml:id="list3093533769" text:style-name="List_20_1">
<text:list xml:id="list211419328837578" text:continue-list="list475153334" text:style-name="Heading_20_Note">
<text:list xml:id="list211418814938759" text:continue-list="list3093533769" text:style-name="List_20_1">
<text:list xml:id="list211418180261711" text:continue-list="list211419328837578" text:style-name="Heading_20_Note">
<text:p xml:id="id3183077804" text:style-name="Text_20_body">Release Notes are here: <text:a xlink:type="simple" xlink:href="https://wiki.documentfoundation.org/ReleaseNotes/7.6" office:name="https://wiki.documentfoundation.org/ReleaseNotes/7.6" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">https://wiki.documentfoundation.org/ReleaseNotes/7.6</text:a>.</text:p>
I see xml:id applied to lists, which is OK
But xml:id is also used in some text:p but not every txt:p in the file.
Question 1 :What is the current rule of using xml:id in text:p ?
Question 2: how to read and set xml:id for text:p in a macro fragment?
Thank you
(*) Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 3: OpenDocument Schema
(**) LibreOffice Developer's Guide: Chapter 6 - Office Development - The Document Foundation Wiki