C# Class SharpVectors.Dom.Svg.SvgDocument

The root object in the document object hierarchy of an Svg document.

When an 'svg' element is embedded inline as a component of a document from another namespace, such as when an 'svg' element is embedded inline within an XHTML document [XHTML], then an ISvgDocument object will not exist; instead, the root object in the document object hierarchy will be a Document object of a different type, such as an HTMLDocument object.

However, an ISvgDocument object will indeed exist when the root element of the XML document hierarchy is an 'svg' element, such as when viewing a stand-alone SVG file (i.e., a file with MIME type "image/svg+xml"). In this case, the ISvgDocument object will be the root object of the document object model hierarchy.

In the case where an SVG document is embedded by reference, such as when an XHTML document has an 'object' element whose href attribute references an SVG document (i.e., a document whose MIME type is "image/svg+xml" and whose root element is thus an 'svg' element), there will exist two distinct DOM hierarchies. The first DOM hierarchy will be for the referencing document (e.g., an XHTML document). The second DOM hierarchy will be for the referenced SVG document. In this second DOM hierarchy, the root object of the document object model hierarchy is an ISvgDocument object.

The ISvgDocument interface contains a similar list of attributes and methods to the HTMLDocument interface described in the Document Object Model (HTML) Level 1 chapter of the [DOM1] specification.

Inheritance: SharpVectors.Dom.Css.CssXmlDocument, ISvgDocument
显示文件 Open project: codebutler/savagesvg Class Usage Examples

Public Properties

Property Type Description
SvgNamespace string
XLinkNamespace string

Public Methods

Method Description
CreateElement ( string prefix, string localName, string ns ) : XmlElement
GetElementById ( string elementId ) : XmlElement
GetNodeByUri ( Uri absoluteUri ) : XmlNode
GetNodeByUri ( string absoluteUrl ) : XmlNode
Load ( Stream stream ) : void

Loads the XML document from the specified stream.

Load ( TextReader reader ) : void

Loads the XML document from the specified TextReader.

Load ( XmlReader reader ) : void

Loads the XML document from the specified XmlReader.

Load ( string url ) : void

Loads the XML document from the specified URL.

Load ( string url, Stream stream ) : void

Loads the XML document from the specified stream but with the specified base URL

Render ( ISvgRenderer renderer ) : void
ResolveUri ( string uri ) : Uri
SetTagNameNodeType ( string prefix, string localName, Type type ) : void
Supports ( string feature, string version ) : bool
SvgDocument ( SvgWindow window ) : System

Protected Methods

Method Description
buildTypeDictionary ( ) : void

buildTypeDictionary

Private Methods

Method Description
LoadAndFire ( XmlReader reader ) : void

Loads the specified XML data and fires load events.

prepareXmlResolver ( XmlReader reader ) : void

Method Details

CreateElement() public method

public CreateElement ( string prefix, string localName, string ns ) : XmlElement
prefix string
localName string
ns string
return System.Xml.XmlElement

GetElementById() public method

public GetElementById ( string elementId ) : XmlElement
elementId string
return System.Xml.XmlElement

GetNodeByUri() public method

public GetNodeByUri ( Uri absoluteUri ) : XmlNode
absoluteUri System.Uri
return System.Xml.XmlNode

GetNodeByUri() public method

public GetNodeByUri ( string absoluteUrl ) : XmlNode
absoluteUrl string
return System.Xml.XmlNode

Load() public method

Loads the XML document from the specified stream.
public Load ( Stream stream ) : void
stream Stream /// The stream containing the XML document to load. ///
return void

Load() public method

Loads the XML document from the specified TextReader.
public Load ( TextReader reader ) : void
reader System.IO.TextReader
return void

Load() public method

Loads the XML document from the specified XmlReader.
public Load ( XmlReader reader ) : void
reader XmlReader /// The XmlReader used to feed the XML /// data into the document. ///
return void

Load() public method

Loads the XML document from the specified URL.
public Load ( string url ) : void
url string /// URL for the file containing the XML document to load. ///
return void

Load() public method

Loads the XML document from the specified stream but with the specified base URL
public Load ( string url, Stream stream ) : void
url string /// Base URL for the stream from which the XML document is loaded. ///
stream Stream /// The stream containing the XML document to load. ///
return void

Render() public method

public Render ( ISvgRenderer renderer ) : void
renderer ISvgRenderer
return void

ResolveUri() public method

public ResolveUri ( string uri ) : Uri
uri string
return System.Uri

SetTagNameNodeType() public method

public SetTagNameNodeType ( string prefix, string localName, Type type ) : void
prefix string
localName string
type System.Type
return void

Supports() public method

public Supports ( string feature, string version ) : bool
feature string
version string
return bool

SvgDocument() public method

public SvgDocument ( SvgWindow window ) : System
window SvgWindow
return System

buildTypeDictionary() protected method

buildTypeDictionary
protected buildTypeDictionary ( ) : void
return void

Property Details

SvgNamespace public_oe static_oe property

public static string SvgNamespace
return string

XLinkNamespace public_oe static_oe property

public static string XLinkNamespace
return string