in reply to Re^3: XML parser to fetch default values of the optional attributes from the xsd file
in thread XML parser to fetch default values of the optional attributes from the xsd file

He's asking how to do (b), if not both (a) and (b), so it's not a very good assumption.

Update: That was not very well put. The following explains what I meant.

I would expect that he wants get_attributes($ele) to return all present attributes and all absent attributes for which the schema defines a default.

To achieve that automatically, one must automatically determine (a) which attributes are missing and (b) what are the default for those attributes.

Another scenario is that he simply wants get_attribute($ele, 'foo') to return the specified value for the attribute, or the default otherwise if it's not specified.

To achieve that automatically, one must automatically determine (b) what is the default for that attribute.

For both scenarios, you simply assumed the OP could already solve all but the trivial portions of his problem.