Table of Contents

Class SvgDocument

Namespace
SharpVectors.Dom.Svg
Assembly
SharpVectors.Model.dll

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

public class SvgDocument : CssXmlDocument, ICloneable, IEnumerable, IXPathNavigable, IEventTargetSupport, IEventTarget, IDocumentEvent, IDocumentCss, IDocumentStyle, ICssView, ISvgDocument, IDocument, INode, IXmlNode
Inheritance
SvgDocument
Implements
Inherited Members

Remarks

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.

Constructors

SvgDocument(SvgWindow)

Fields

DotsPerInch
SvgNamespace
XLinkNamespace
XmlIdUrl

Namespace URI to map to the xml prefix

Properties

BaseURI

Gets the base URI of the current node.

CustomSettings
Domain

The domain name of the server that served the document, or a null string if the server cannot be identified by a domain name.

Dpi

Get or sets the dots per inch at which the objects should be rendered.

ElementMap
ElementUniqueMap
FontFamilies
GlobalSettings
IsFontsLoaded
NamespaceManager
OwnerDocument
Referrer

Returns the URI of the page that linked to this page. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark).

RootElement

The root 'svg' element in the document hierarchy

StyledFontIds
SvgFontFamilies
SvgFonts
Title

The title of the document which is the text content of the first child title element of the 'svg' root element.

Window

Methods

CreateElement(string, string, string)

Creates an element with the specified Prefix, LocalName, and NamespaceURI.

GetElementById(string)

Gets the XmlElement with the specified ID.

GetFontUrls()
GetFonts(IList<string>)
GetFonts(string)
GetNodeByUri(string)
GetNodeByUri(Uri)
GetSvgById(string)
GetSvgByUniqueId(Guid)
GetSvgByUniqueId(string)
IsGZipped(Stream)
Load(Stream)

Loads the XML document from the specified stream.

Load(TextReader)

Loads the XML document from the specified TextReader.

Load(string)

Loads the XML document from the specified URL.

Load(string, Stream)

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

OnLoaded()
RegisterFont(SvgFontElement)
ResolveUri(string)
Supports(string, string)

Test if the DOM implementation implements a specific feature.

Events

ResolveNamespace

Occurs when a namespace is being resolved.

ResolvingUri

Occurs when an URI is resolved (always).