Chilkat VB.NET Atom Class Reference

Atom

Represents an Atom document. The Atom API allows one to download, create and modify Atom documents.

Properties

EnableEvents As Boolean

To be documented soon...

LastErrorHtml As String (ReadOnly)

Error information in HTML format for the last method called.

LastErrorText As String (ReadOnly)

Error information in plain-text format for the last method called.

LastErrorXml As String (ReadOnly)

Error information in XML format for the last method called.

NumEntries As Integer (ReadOnly)

Number of entries in the Atom document.

Methods

Function AddElement(ByVal tag As String, ByVal value As String) As Integer

Adds a new element to the Atom document. The tag is a string such as "title", "subtitle", "summary", etc.

Function AddElementDate(ByVal tag As String, ByVal dateTime As Date) As Integer

Adds a new date-formatted element to the Atom document. The tag is a string such as "created", "modified", "issued", etc.

Function AddElementHtml(ByVal tag As String, ByVal htmlStr As String) As Integer

Adds a new HTML formatted element to the Atom document.

Function AddElementXHtml(ByVal tag As String, ByVal xmlStr As String) As Integer

Adds a new XHTML formatted element to the Atom document.

Function AddElementXml(ByVal tag As String, ByVal xmlStr As String) As Integer

Adds a new XML formatted element to the Atom document.

Sub AddEntry(ByVal xmlStr As String)

Adds an "entry" Atom XML document to the caller's Atom document.

Sub AddLink(ByVal rel As String, ByVal href As String, ByVal title As String, ByVal typ As String)

Adds a link to the Atom document.

Sub AddPerson(ByVal tag As String, ByVal name As String, ByVal uri As String, ByVal email As String)

Adds a person to the Atom document. The tag should be a string such as "author", "contributor", etc. If a piece of information is not known, an empty string or NULL value may be passed.

Sub DeleteElement(ByVal tag As String, ByVal index As Integer)

Removes the Nth occurance of a given element from the Atom document. Indexing begins at 0. For example, to remove the 2nd category, set tag = "category" and index = 1.

Sub DeleteElementAttr(ByVal tag As String, ByVal index As Integer, ByVal attrName As String)

Remove an attribute from an element.The index should be 0 unless there are multiple elements having the same tag, in which case it selects the Nth occurrence based on the index ( 0 = first occurrence ).

Sub DeletePerson(ByVal tag As String, ByVal index As Integer)

Deletes a person from the Atom document. The tag is a string such as "author". The index should be 0 unless there are multiple elements having the same tag, in which case it selects the Nth occurrence based on the index. For example, DeletePerson("author",2) deletes the 3rd author.

Function DownloadAtom(ByVal url As String) As Boolean

Download an Atom feed from the Internet and load it into the Atom object.

Returns true for success, false for failure.

Function GetElement(ByVal tag As String, ByVal index As Integer) As String

Returns the content of the Nth element having a specified tag.

Returns Nothing on failure

Function GetElementAttr(ByVal tag As String, ByVal index As Integer, ByVal attrName As String) As String

Returns the value of an element's attribute. The element is selected by the tag name and the index (the Nth element having a specific tag) and the attribute is selected by name.

Returns Nothing on failure

Function GetElementCount(ByVal tag As String) As Integer

The number of elements having a specific tag.

Function GetElementDate(ByVal tag As String, ByVal index As Integer) As Date

Returns an element's value as a Date.

Function GetEntry(ByVal index As Integer) As Atom

Returns the Nth entry as an Atom object. (Indexing begins at 0)

Function GetLinkHref(ByVal relName As String) As String

Returns the href attribute of the link having a specified "rel" attribute (such as "service.feed", "alternate", etc.).

Returns Nothing on failure

Function GetPersonInfo(ByVal tag As String, ByVal index As Integer, ByVal tag2 As String) As String

Returns a piece of information about a person. To get the 2nd author's name, call GetPersonInfo("author",1,"name").

Returns Nothing on failure

Function GetTopAttr(ByVal attrName As String) As String

Returns the value of an attribute on the top-level XML node. The tag of a top-level Atom XML node is typically "feed" or "entry", and it might have attributes such as "xmlns" and "xml:lang".

Returns Nothing on failure

Function HasElement(ByVal tag As String) As Boolean

True (1) if the element exists in the Atom document. Otherwise 0.

Function LoadXml(ByVal xmlStr As String) As Boolean

Loads the Atom document from an XML string.

Sub NewEntry()

Initializes the Atom document to be a new "entry".

Sub NewFeed()

Initializes the Atom document to be a new "feed".

Function SaveLastError(ByVal filename As String) As Boolean

Saves the last error information to an XML formatted file.

Sub SetElementAttr(ByVal tag As String, ByVal index As Integer, ByVal attrName As String, ByVal attrValue As String)

Adds or replaces an attribute on an element.

Sub SetTopAttr(ByVal attrName As String, ByVal value As String)

Adds or replaces an attribute on the top-level XML node of the Atom document.

Function ToXmlString() As String

Serializes the Atom document to an XML string.

Returns Nothing on failure

Sub UpdateElement(ByVal tag As String, ByVal index As Integer, ByVal value As String)

Replaces the content of an element.

Sub UpdateElementDate(ByVal tag As String, ByVal index As Integer, ByVal dateTime As Date)

Replaces the content of a date-formatted element.

Sub UpdateElementHtml(ByVal tag As String, ByVal index As Integer, ByVal htmlStr As String)

Replaces the content of an HTML element.

Sub UpdateElementXHtml(ByVal tag As String, ByVal index As Integer, ByVal xmlStr As String)

Replaces the content of an XHTML element.

Sub UpdateElementXml(ByVal tag As String, ByVal index As Integer, ByVal xmlStr As String)

Replaces the content of an XML element.

Sub UpdatePerson(ByVal tag As String, ByVal index As Integer, ByVal name As String, ByVal uri As String, ByVal email As String)

Replaces the content of a person. To update the 3rd author, call UpdatePerson("author",2,"new name","new URL","new email"). If a piece of information is not known, pass an empty string or a NULL.