SFormXMLParser Class Reference

Inherits from NSObject
Declared in SFormXMLParser.h
Availability
Related samples

Overview

An object capable of prasing XML to create a ShinobiForm.

This parser can parse an XML string conforming to the XSD provided with this framework (ShinobiForms_XSD.xml).

Instance Methods

formFromXml:xmlEncoding:xsd:xsdEncoding:

Create a form from XML.

- (ShinobiForm *)formFromXml:(NSString *)xml xmlEncoding:(NSStringEncoding)xmlEncoding xsd:(NSString *)xsd xsdEncoding:(NSStringEncoding)xsdEncoding

Parameters

xml

The XML string defining the form.

xmlEncoding

The encoding of the xml string.

xsd

The XSD string to validate the xml against. If nil, an attempt will be made to load ShinobiForms_XSD.xml from your application’s bundle.

xsdEncoding

The encoding of the xsd string.

Return Value

A ShinobiForm model built from the provided xml string.

Discussion

Attempts to create a form from the given XML string.

The xml string will be validated against the given xsd string. If no xsd string is provided, this method will attempt to load ShinobiForms_XSD.xml from your application’s main bundle. If this xsd can’t be found, the method will return nil.

Declared In

SFormXMLParser.h

isValidXml:xmlEncoding:xsd:xsdEncoding:

Validate a given XML string against a given XSD.

- (BOOL)isValidXml:(NSString *)xml xmlEncoding:(NSStringEncoding)xmlEncoding xsd:(NSString *)xsd xsdEncoding:(NSStringEncoding)xsdEncoding

Parameters

xml

The XML string to validate.

xmlEncoding

The encoding of the xml string.

xsd

The XSD string to validate the xml against.

xsdEncoding

The encoding of the xsd string.

Return Value

A BOOL that indicates the validity of the xml.

Discussion

The xml string will be validated against the given xsd string. If no xsd string is provided, this method will attempt to load ShinobiForms_XSD.xml from your application’s main bundle. If this xsd can’t be found, the method will return nil.

Declared In

SFormXMLParser.h