Adding a specific attritbue/value pair for a selection of elements
Posted: Mon Aug 07, 2023 3:31 pm
Hello,
Our documentation sometimes uses very long tables with some referential information. A simplified excerpt:
I need to add a specific attribute/value pair to a custom selection (based on the number in the "Priority" column) of <entry> elements in the second column.
Is there any efficient way of doing that? The tables can have dozens of rows, so I need a way to apply such bulk changes.
I'd rather avoid using Find/Replace regex in Text mode to match specific entries and add an attribute for those entries. For example, to match entries with element value between "5.5" and "6.5":
The reason for that is I'm looking for something that's built into Oxygen to enable authors not versed in regex to make such changes.
Kind regards,
Konrad
Our documentation sometimes uses very long tables with some referential information. A simplified excerpt:
Code: Select all
<table>
<tgroup>
<thead>
<row>
<entry>Issue</entry>
<entry>Priority</entry>
<entry>Description</entry>
<entry>URL</entry>
</row>
</thead>
<tbody>
<row>
<entry>NUMBER1</entry>
<entry>9.8</entry>
<entry>TEXT
</entry>
<entry>XREF</entry>
</row>
<row>
<entry>NUMBER1</entry>
<entry>9</entry>
<entry>TEXT
</entry>
<entry>XREF</entry>
</row>
<row>
<entry>NUMBER1</entry>
<entry>8.5</entry>
<entry>TEXT
</entry>
<entry>XREF</entry>
</row>
<row>
<entry>NUMBER1</entry>
<entry>7.4</entry>
<entry>TEXT
</entry>
<entry>XREF</entry>
</row>
<row>
<entry>NUMBER1</entry>
<entry>7.2</entry>
<entry>TEXT
</entry>
<entry>XREF</entry>
</row>
[...]
Is there any efficient way of doing that? The tables can have dozens of rows, so I need a way to apply such bulk changes.
I'd rather avoid using Find/Replace regex in Text mode to match specific entries and add an attribute for those entries. For example, to match entries with element value between "5.5" and "6.5":
Code: Select all
Find: <entry>(5\.([5-9]|[0-9]\d*)|6\.[0-5])</entry>
Replace: <entry outputclass="priorityX">$1</entry>
Kind regards,
Konrad