@@ -119,19 +119,27 @@ /** * @brief Parses the string and returns an OFXMLElement for it. * * @param string The string to parse * @return A new autoreleased OFXMLElement with the contents of the string + * @throw OFMalformedXMLException The XML was malformed + * @throw OFUnboundPrefixException A prefix was used that was not bound to any + * namespace + * @throw OFInvalidEncodingException The XML is not in the encoding it specified */ + (instancetype)elementWithXMLString: (OFString *)string; /** * @brief Parses the specified stream and returns an OFXMLElement for it. * * @param stream The stream to parse * @return A new autoreleased OFXMLElement with the contents of the specified * stream + * @throw OFMalformedXMLException The XML was malformed + * @throw OFUnboundPrefixException A prefix was used that was not bound to any + * namespace + * @throw OFInvalidEncodingException The XML is not in the encoding it specified */ + (instancetype)elementWithStream: (OFStream *)stream; - (instancetype)init OF_UNAVAILABLE; @@ -186,19 +194,27 @@ * @brief Parses the string and initializes an already allocated OFXMLElement * with it. * * @param string The string to parse * @return An initialized OFXMLElement with the contents of the string + * @throw OFMalformedXMLException The XML was malformed + * @throw OFUnboundPrefixException A prefix was used that was not bound to any + * namespace + * @throw OFInvalidEncodingException The XML is not in the encoding it specified */ - (instancetype)initWithXMLString: (OFString *)string; /** * @brief Parses the specified stream and initializes an already allocated * OFXMLElement with it. * * @param stream The stream to parse * @return An initialized OFXMLElement with the contents of the specified stream + * @throw OFMalformedXMLException The XML was malformed + * @throw OFUnboundPrefixException A prefix was used that was not bound to any + * namespace + * @throw OFInvalidEncodingException The XML is not in the encoding it specified */ - (instancetype)initWithStream: (OFStream *)stream; /** * @brief Sets a prefix for a namespace. @@ -393,10 +409,13 @@ * with the specified indentation per level. * * @param indentation The indentation per level * @return An OFString representing the OFXMLNode as an XML string with * indentation + * @throw OFUnboundNamespaceException The node uses a namespace that was not + * bound to a prefix in a context where it + * needs a prefix */ - (OFString *)XMLStringWithIndentation: (unsigned int)indentation; /** * @brief Returns an OFString representing the OFXMLElement as an XML string @@ -404,13 +423,16 @@ * * @param defaultNS The default namespace * @param indentation The indentation per level * @return An OFString representing the OFXMLNode as an XML string with * indentation + * @throw OFUnboundNamespaceException The node uses a namespace that was not + * bound to a prefix in a context where it + * needs a prefix */ - (OFString *)XMLStringWithDefaultNamespace: (OFString *)defaultNS indentation: (unsigned int)indentation; @end OF_ASSUME_NONNULL_END #import "OFXMLElement+Serialization.h"