Humm in this file in XML I want to search attributes "comment" and maybe other like location, etc
</element>
<element type="embed://import/10_electric/10_allpole/310_relays_contactors_contacts/01_coils/bobine3.elmt" freezeLabel="false" prefix="" uuid="{3b02493a-0cc1-4596-8d05-b04f4e0c5aed}" orientation="0" y="350" z="10" x="500">
<terminals>
<terminal id="12" orientation="0" y="-16" x="0"/>
<terminal id="13" orientation="2" y="16" x="0"/>
</terminals>
<inputs/>
<links_uuids>
<link_uuid uuid="{086f7776-ce74-4ce4-990e-c9dd4d1bf64a}"/>
<link_uuid uuid="{d73712d9-b8a3-4755-aaa7-f2d287dd8f41}"/>
</links_uuids>
<elementInformations>
<elementInformation show="1" name="comment">marche pompe 1</elementInformation>
<elementInformation show="1" name="label">ka1</elementInformation>
<elementInformation show="1" name="location">localisation</elementInformation>
</elementInformations>
<dynamic_texts>
<dynamic_elmt_text keep_visual_rotation="false" Valignment="AlignTop" rotation="0" uuid="{18710f6f-f869-4095-9d52-546d1aa1873b}" text_from="UserText" Halignment="AlignLeft" y="11.3333" font="Sans Serif,4,-1,5,25,0,0,0,0,0" x="2" frame="false" text_width="-1">
<text>A2</text>
</dynamic_elmt_text>
<dynamic_elmt_text keep_visual_rotation="false" Valignment="AlignTop" rotation="0" uuid="{7b284f9c-3044-441b-9eda-f083b33e4a6f}" text_from="UserText" Halignment="AlignLeft" y="-24.6667" font="Sans Serif,4,-1,5,25,0,0,0,0,0" x="2" frame="false" text_width="-1">
<text>A1</text>
</dynamic_elmt_text>
<dynamic_elmt_text keep_visual_rotation="false" Valignment="AlignTop" rotation="0" uuid="{1b8862ad-2a23-4db0-a878-415ab778840e}" text_from="ElementInfo" Halignment="AlignLeft" y="-9.1667" font="Sans Serif,9,-1,5,50,0,0,0,0,0" x="25" frame="false" text_width="-1">
<text>ka1</text>
<info_name>label</info_name>
</dynamic_elmt_text>
</dynamic_texts>
I'm pulling my hair out and I don't need it ! ...with xmlstarlet if anyone has any ideas?
xmlstarlet sel -T -t -m /project/diagram/conductors/conductor -s A:N:- "@num" -v "concat(@num,';',@conductor_color,';',@function,';',@tension_protocol,';',@conductor_section,';',@element1_label,';',@terminalname1,';',@element1_name,';',@element1_linked,';',element1_linked/elementInformations/elementInformation[@name='comment']/@value,';' ,@element1_label,';',@element2_label,';',@element2_name,';',element2_linked/elementInformations/elementInformation[@name='comment']/@value,';',@element2_linked,';',@terminalname2,';')" -n sansnom2.qet >list_num77.csv
Maybe I'm going the wrong way with xmlstarlet and should try xmllilnt?