C# Class XmlHelper, TabMigrate

Inheritance: MonoBehaviour
Mostra file Open project: tableau/TabMigrate Class Usage Examples

Public Methods

Method Description
BoolToXmlText ( bool value ) : string

Gives us a culture invariant true/false text for XML

CreateTableauXmlNamespaceManager ( string prefix ) : XmlNamespaceManager

Creates a namespace manager needed for XML XPath queries

GetAttributeValue ( XmlNode xmlNode, string nodeName, string attributeName, bool searchSiblings, bool &found ) : string

Recursive search for first matching node, returning attribute

RequiredParseXmlAttribute ( XmlNode xNode, string attributeName ) : string

Gets the attribute or returns a default value

SafeParseXmlAttribute ( XmlNode xNode, string attributeName, string defaultValue ) : string

Gets the attribute or returns a default value

SafeParseXmlAttribute_Bool ( XmlNode xNode, string attributeName, bool defaultValue ) : bool
WriteBooleanAttribute ( XmlWriter xmlWriter, string attributeName, bool value ) : void

Writes out a true/false attribute value

Private Methods

Method Description
ReadBooleanAttribute ( XmlNode xNode, string attributeName, bool defaultValue ) : bool

Reads a true/false value

ReadTextAttribute ( XmlNode xNode, string attributeName, string defaultValue = "" ) : string

Reads a true/false value

WriteValueElement ( XmlWriter xmlWriter, string elementName, bool value ) : void

Write a simple name/value pair as an XML element

WriteValueElement ( XmlWriter xmlWriter, string elementName, string value ) : void

Write a simple name/value pair as an XML element

Method Details

BoolToXmlText() public static method

Gives us a culture invariant true/false text for XML
public static BoolToXmlText ( bool value ) : string
value bool
return string

CreateTableauXmlNamespaceManager() public static method

Creates a namespace manager needed for XML XPath queries
public static CreateTableauXmlNamespaceManager ( string prefix ) : XmlNamespaceManager
prefix string
return XmlNamespaceManager

GetAttributeValue() public static method

Recursive search for first matching node, returning attribute
public static GetAttributeValue ( XmlNode xmlNode, string nodeName, string attributeName, bool searchSiblings, bool &found ) : string
xmlNode XmlNode
nodeName string
attributeName string
searchSiblings bool
found bool
return string

RequiredParseXmlAttribute() public static method

Gets the attribute or returns a default value
public static RequiredParseXmlAttribute ( XmlNode xNode, string attributeName ) : string
xNode XmlNode
attributeName string
return string

SafeParseXmlAttribute() public static method

Gets the attribute or returns a default value
public static SafeParseXmlAttribute ( XmlNode xNode, string attributeName, string defaultValue ) : string
xNode XmlNode
attributeName string
defaultValue string
return string

SafeParseXmlAttribute_Bool() public static method

public static SafeParseXmlAttribute_Bool ( XmlNode xNode, string attributeName, bool defaultValue ) : bool
xNode XmlNode
attributeName string
defaultValue bool
return bool

WriteBooleanAttribute() public static method

Writes out a true/false attribute value
public static WriteBooleanAttribute ( XmlWriter xmlWriter, string attributeName, bool value ) : void
xmlWriter XmlWriter
attributeName string
value bool
return void