Get the text from a RSS Resource

Is there a any better and shorter programming to get the text what we need?

Thanks for help!!

1 Like

Hello DickLiu

Instead of an image, please upload the RSS data as a text file.

Question: Is the text you need always in the lines as marked up? (lines 4, 8 and 14)

RSS Data:https://invoice.etax.nat.gov.tw/invoice.xml

In this moment I just need the text of lines 4, 8 and 14.

Thanks!

There is a very powerful dictionary block that accepts a path and dictionary or list, to dive deep into a structure like yours:
dictionaries_walk_tree

Here is what your data structure looks like, tidied up:

XML_to_dict.aia (5.2 KB)

I leave it to you to experiment, since it's your elegance/effort tradeoff.

@DickLu

I have added the XmlToJson block (which converts an XML string to another JSON string) to my extension and I am testing it with your example.

This XmlToJson block has some problems with XML CDATA codes, but it works.

XmlToJson.aia (608.5 KB)

Thanks! I would try it!

Thanks for your reply!!

Fixed "problems with XML CDATA codes"

Get_XML_JSON.aia (582.7 KB)

Updated KIO4_DecoJson.aix extension.
Now XmlToJson and JsonToXml

1 Like

Thank you so much!!