Hello café,
I have seen tutorials about extracting information from a tag soup, but I have a different use case:
I want to read a xml file, find a tag, change its content, and write the xml file back.
This is an example of the files
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="7.0">
<Story Self="ub9fad" AppliedTOCStyle="n" TrackChanges="false" StoryTitle="$ID/" AppliedNamedGrid="n">
<StoryPreference OpticalMarginAlignment="false" OpticalMarginSize="12" FrameType="TextFrameType" StoryOrientation="Horizontal" StoryDirection="LeftToRightDirection"/>
<InCopyExportOption IncludeGraphicProxies="true" IncludeAllResources="false"/>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/prix">
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
<Content>zzznba5</Content>
</CharacterStyleRange>
</ParagraphStyleRange>
</Story>
</idPkg:Story>
Assuming I want to change the content of the "Content" tag, this is what I came up with (simplified), I'm using direct recursion. Is there a better way ?