lundi 29 juin 2015

How to count a specific tags in xml file?

XML:

<chapter>
<openr><title><num aid:pstyle="_CN">1</num></openr>
<media.block id="fig001"><media type="image"/><caption aid:pstyle="Caption"><num>FIG. 1.1&#x2002;</num><para><txt>some text</txt></para></caption></media.block>
<txt>some</txt>
<media.block id="fig002"><media type="image"/><caption aid:pstyle="Caption"><num>FIG. 1.2&#x2002;</num><para><txt>some text</txt></para></caption></media.block>
</chapter>

I need to extract the count of <media.block(to get the no.of figures in a document) and the content of <num aid:pstyle="_CN">1</num>(here ans=1).

I don't know how to access XML element using extendscript. Atleast a hint would be more than enough

Aucun commentaire:

Enregistrer un commentaire