You are here:  » undefined index


undefined index

Submitted by andras on Tue, 2009-04-28 21:08 in

hello there,

i get a lot of "Notice: Undefined index:" errors, which appear to be a result of missing nodes (terminology?) in my xml file; that is, not all entries have all their properties populated and the xml is completely missing tags for those.

consider:

<item>
<property1>this</property1>
<property2>that</property2>
</item>
<item>
<property2>thisandthat</property2>
</item>

your demo page, however does not display these notices, and so i wonder how i may supress them . . .

on a separate note: shouldn't the last bit at http://www.magicparser.com/node/53 be "MagicParser_parse($filename,"myRecordHandler",$format_string);" vs. "MagicParser_parse($filename,"myRecordHandler",$format);"?

-andras

Submitted by support on Tue, 2009-04-28 21:13

Hi Andras,

That sounds like your PHP installation has warning levels turned up to the max.

Try the following code at the top of your script:

  error_reporting(E_ERROR);

That should restrict notices to actual errors...

Cheers,
David.

Submitted by andras on Tue, 2009-04-28 21:16

looking good already - thanks.