from_xml


Description:

[ CCode ( cname = "gdata_parsable_new_from_xml" ) ]
[ Version ( since = "0.4.0" ) ]
public static Parsable from_xml (Type parsable_type, string xml, int length) throws Error

Creates a new Parsable subclass (of the given parsable_type) from the given xml.

An object of the given parsable_type is created, and its pre_parse_xml, parse_xml and post_parse_xml class functions called on the XML tree obtained from xml. pre_parse_xml and post_parse_xml are called once each on the root node of the tree, while parse_xml is called for each of the child nodes of the root node.

If length is -1, xml will be assumed to be null-terminated.

If an error occurs during parsing, a suitable error from ParserError will be returned.

Parameters:

parsable_type

the type of the class represented by the XML

xml

the XML for just the parsable object, with full namespace declarations

length

the length of xml, or -1

Returns:

a new Parsable, or null; unref with unref