Isolate first record
Submitted by aslater on Mon, 2009-05-18 18:42.Magic Parser
Hello is it possible to isolate the first record in an XML file using magic parser, so I can add additional css and html to format this record only?
Thanks
Support forum loginActive forum topics©2006-2012 IAAI Software |
Isolate first recordSubmitted by aslater on Mon, 2009-05-18 18:42.Magic Parser
Hello is it possible to isolate the first record in an XML file using magic parser, so I can add additional css and html to format this record only? Thanks |
Hi,
Sure; you could do this using global variables; for example:
$first = TRUE;function myRecordHandler($record)
{
global $first;
if ($first)
{
// add additional css and html here
$first = FALSE;
}
}
However, unless you want to refer to fields within $record in order to generate that HTML (such as generating a dynamic title element for example) it is the same as just creating that output anywhere in your script before you call MagicParser_parse()...
Hope this helps!
Cheers,
David.