Sample Header Ad - 728x90

xmlstarlet how to select tag immediately before selected tag

0 votes
1 answer
512 views
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 ` or tags having a paragraphe style attribute. I can reach the object containing one of these, but i need to reach the tag ` 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 :
I can also reach the ` but how can i reach the ` node ?
Asked by JLuc (111 rep)
May 28, 2021, 05:24 PM
Last activity: May 28, 2021, 09:21 PM