I scan scribus SLA files and wish to find the text having some specific paragraph styles.
SLA file format is a quite flat XML format and there are several paragraphs in a row, each being separated with either <trail/>
or <para/>
tags having a paragraphe style attribute. I can reach the <StoryText>
object containing one of these, but i need to reach the tag <ITEXT>
coming immediately before it because its CH attributes contains the text i'm looking for.
Here is how i reach the containing StoryText :
xmlstarlet sel -t -c "SCRIBUSUTF8NEW/DOCUMENT/PAGEOBJECT/StoryText [para/@PARENT='SearchedStyle']" myfile.sla
It yields for example :
<StoryText>
<DefaultStyle/>
<ITEXT CH="Et main­te­nant"/>
<breakline/>
<ITEXT CH="qu’est ce qu’on fait ?"/>
<para PARENT="SomeOtherParagraphStyle"/>
<para/>
<ITEXT CH="The Calendar"/>
<trail PARENT="SearchedStyle"/>
</StoryText>
I can also reach the <trail PARENT="SearchedStyle"/>
but how can i reach the <ITEXT CH="The Calendar"/>
node ?