My feed has - amongst other things - a repeting element as follows:
The magicparser read that as:
CHANNEL/ITEM/YWEATHER:FORECAST-CODE
CHANNGEL/ITEM/YWEATHER:FORECAST@1-CODE
The first element I'm able to catch with:
wf1code = '".mysql_real_escape_string( $record ["CHANNEL/YWEATHER:FORECAST-CODE"] )."'
But I'm not able to catch the second element with:
wf2code = '".mysql_real_escape_string( $record ["CHANNEL/YWEATHER:FORECAST@1-CODE"] )."'
Thank you very much for your help.
Hi There,
Have you downloaded the latest version of Magic Parser, as this repeating element resolution using @n has only been included as of this morning.
If you have an older version; whilst the demo script on this website will show the segregation the version you have may not.
I'll continue doing some tests to check that there is no reason why key names containing @ shouldn't be picked up using the code you posted - which looks fine...
Hi again,
I just tested with the following code - could you possibly try this with your current weather.xml containing the items above.
<?php
require("MagicParser.php");
function myRecordHandler($record)
{
print "<p>".$record["YWEATHER:FORECAST-CODE"]."</p>";
print "<p>".$record["YWEATHER:FORECAST@1-CODE"]."</p>";
}
$result = MagicParser_parse("weather.xml","myRecordHandler","xml|RSS/CHANNEL/ITEM/");
?>
If the above doesn't work; would it be possible for you to email me the XML document you're using (reply to your Magic Parser registration code email) and i'll try it on exactly the same file...
Thanks,
David.
The disappeard code again:
<yweather:forecast day="Tue" date="07 Mar 2006" low="-4" high="0" text="Snow Showers Late" code="46" />
<yweather:forecast day="Wed" date="08 Mar 2006" low="5" high="6" text="Rain/Snow" code="5" />