I'm am pretty new to coding and still learning the ropes. I got an XML feed that I'm processing where, amongst other common data that is easy to process, I can get complex elements such as :
<para>Text before the <a href="www.alink.com">Link</a> more text after the link.</para>.
I get the data out of XML by simplexml_load_string($xml), perhapes this is where I'm going wrong.
What is the best way to process an XML file where there may or may not be 'inline child' elements so that the output looks as it should.
I can get the data out but what I end up with is 2 entries, "Text before the Link more text after the link." and the link itself.
Seems simple and I'm sure others may have run into this but I'm not sure how do you preserve the original markup. I have been trying to find an answer to this with the good old google but I must be not using the right wording. Any help or a pointer to a resource would be much appreciated. I have gone through a few tutorials online but I'm unsure what I'm doing wrong.
Thanks.
No comments:
Post a Comment