C# Class SWFProcessing.Swiffotron.Processor.XMLHelper

Datei anzeigen Open project: WeeWorld/Swiffotron Class Usage Examples

Public Methods

Method Description
ColorAttribute ( XPathNavigator nav, string name ) : Color?

Gets an HTML colour attribute value from an XML node

CreateValidationSettings ( string schemaName ) : XmlReaderSettings

For a given schema name (Named resource) this loads the schema XML and creates an XmlReaderSettings object which can be used to validate any XML read by the Swiffotron. This is called in the static initialiser.

IntegerAttribute ( XPathNavigator nav, string name ) : int?

Gets an integer attribute value from an XML node

LoadConfigurationXML ( Stream configXml ) : void

Loads a swiffotron config XML file, validates it and sets the current namespace manager so that we can do XPath queries in the 'con' namespace.

LoadSwiffotronXML ( Stream swiffotronXml ) : void

Loads a swiffotron job XML file, validates it and sets the current namespace manager so that we can do XPath queries in the 'swf' namespace.

MoveToFirstChildElement ( XPathNavigator nav ) : void

Convenience method to move a navigator to the first child element, rather than first child node, which could be text or something.

Select ( XPathNavigator top, string path ) : XPathNodeIterator
Select ( string path ) : XPathNodeIterator
SelectBoolean ( string path, bool defaultValue = null ) : bool
SelectChildren ( XPathNavigator top, string path ) : XPathNodeIterator
SelectNode ( XPathNavigator top, string path ) : XPathNavigator
SelectNode ( string path ) : XPathNavigator
SelectString ( string path, string defaultValue = null ) : string
SetContext ( SwiffotronContext ctx ) : void
SwfTagFromRef ( XPathNavigator referee ) : XPathNavigator

Find a swf xml node by a reference

TransformTagToMatrix ( XPathNavigator transform ) : Matrix

Creates a new position matrix from an XML declaration of one.

XMLHelper ( ) : System

Method Details

ColorAttribute() public method

Gets an HTML colour attribute value from an XML node
public ColorAttribute ( XPathNavigator nav, string name ) : Color?
nav System.Xml.XPath.XPathNavigator A pointer to the node
name string The attribute to get
return Color?

CreateValidationSettings() public static method

For a given schema name (Named resource) this loads the schema XML and creates an XmlReaderSettings object which can be used to validate any XML read by the Swiffotron. This is called in the static initialiser.
public static CreateValidationSettings ( string schemaName ) : XmlReaderSettings
schemaName string Named resource which is an XSD file.
return System.Xml.XmlReaderSettings

IntegerAttribute() public method

Gets an integer attribute value from an XML node
public IntegerAttribute ( XPathNavigator nav, string name ) : int?
nav System.Xml.XPath.XPathNavigator A pointer to the node
name string The attribute to get
return int?

LoadConfigurationXML() public method

Loads a swiffotron config XML file, validates it and sets the current namespace manager so that we can do XPath queries in the 'con' namespace.
public LoadConfigurationXML ( Stream configXml ) : void
configXml Stream
return void

LoadSwiffotronXML() public method

Loads a swiffotron job XML file, validates it and sets the current namespace manager so that we can do XPath queries in the 'swf' namespace.
public LoadSwiffotronXML ( Stream swiffotronXml ) : void
swiffotronXml Stream A stream feeding XML data.
return void

MoveToFirstChildElement() public method

Convenience method to move a navigator to the first child element, rather than first child node, which could be text or something.
public MoveToFirstChildElement ( XPathNavigator nav ) : void
nav System.Xml.XPath.XPathNavigator The navigator to move
return void

Select() public method

public Select ( XPathNavigator top, string path ) : XPathNodeIterator
top System.Xml.XPath.XPathNavigator
path string
return System.Xml.XPath.XPathNodeIterator

Select() public method

public Select ( string path ) : XPathNodeIterator
path string
return System.Xml.XPath.XPathNodeIterator

SelectBoolean() public method

public SelectBoolean ( string path, bool defaultValue = null ) : bool
path string
defaultValue bool
return bool

SelectChildren() public method

public SelectChildren ( XPathNavigator top, string path ) : XPathNodeIterator
top System.Xml.XPath.XPathNavigator
path string
return System.Xml.XPath.XPathNodeIterator

SelectNode() public method

public SelectNode ( XPathNavigator top, string path ) : XPathNavigator
top System.Xml.XPath.XPathNavigator
path string
return System.Xml.XPath.XPathNavigator

SelectNode() public method

public SelectNode ( string path ) : XPathNavigator
path string
return System.Xml.XPath.XPathNavigator

SelectString() public method

public SelectString ( string path, string defaultValue = null ) : string
path string
defaultValue string
return string

SetContext() public method

public SetContext ( SwiffotronContext ctx ) : void
ctx SwiffotronContext
return void

SwfTagFromRef() public method

Find a swf xml node by a reference
public SwfTagFromRef ( XPathNavigator referee ) : XPathNavigator
referee System.Xml.XPath.XPathNavigator A movieclip, or instance tag
return System.Xml.XPath.XPathNavigator

TransformTagToMatrix() public method

Creates a new position matrix from an XML declaration of one.
public TransformTagToMatrix ( XPathNavigator transform ) : Matrix
transform XPathNavigator The navigator pointing to the XML transform element.
return Matrix

XMLHelper() public method

public XMLHelper ( ) : System
return System