I am writing a script that will feed data directly from an XML source. I have managed to get the script to work but I’m having trouble importing one of the data fields properly and I’m looking for a bit of insight. I’ll break it down for you.
The XML Data (A yearly horoscope report) is structured like so:
I get the first paragraph (ID=“1”) but that’s all.
I have tried changing this to all sorts. I’ve tried adding ID=“1” through to ID=“4” but none of them produce anything. In fact, if I add anything to the end of my string, it doesn’t produce any results at all, not even the first paragraph. I’ve tried it with spaces, without spaces, with speech marks, without speech marks, with brackets, with curly brackets, with square brackets… I cannot think of any other way of attaching the required attribute so my script knows to pull ID=“2” or ID=“3” instead of just bringing up the first instance of the referenced element.
So my question is… how do I correctly call an XML Element dependant on the ID Attribute it has been given instead of just calling the first instance of the said element?