Check the file "aspXML_example.asp" for a sample that uses most methods.
Method Name |
Description |
Example |
OpenTag(tagName) | Opens a new element tag named tagName | myXML.OpenTag "xmlRoot" |
CloseTag | Closes the last open tag. | myXML.CloseTag |
CloseAllTags | Closes all open tags since the creation of the instance. | myXML.CloseAllTags |
AddAttribute(attributeName, attributeValue) | Adds an attribute to the last open tag, can be called as much times as the tags we need to add. | myXML.AddAttribute "name", "Rami") |
AddData(data) | Adds data to the last open tag. Note: this method detects automatically if the data need CDATA section or no. |
myXML.AddData "To be or not to be" |
QuickTag(tagName, tagData) | This is for quick information, opens a tag named "tagName", adds the data, then closes the tag. | myXML.QuickTag "Quote", "An apple a day keeps the doctor away :-)" |
EmptyTag(tagName) | Adds an empty tag. Should be used when we want to add an
empty tag to reduce the size of the output XML code. You can open and close a tag without adding data, but this method uses less space. |
myXML.EmptyTag "emptyTag" |
AddDate(dateDate) | Adds a date to the last open tag using the default date format specified in XML Schema, which is "yyyy-mm-ddThh:mm:ss" | myXML.AddDate now() |
AddComment(comment) | Adds an XML comment. | myXML.AddComment "This is a comment" |
GetXML | Returns the XML code to the caller | myXML.GetXML |
Reset | Resets the class as if it has been just called, all data will be lost. | myXML.Reset |
Copyright© 2002 KattanWeb.com,
all rights reserved