Useful Links

Friday, July 20, 2007

Methods and properties of Microsoft.XMLDOM

Document

Properties

asyncboolean: specifies whether asynchronous download of the document is permitted.
doctype
documentElement
implementation
ondataavailable [ie]
onreadystateChange [ie]
ontransformnode [ie]
parseError [ie]
preserveWhiteSpace [ie]
readyState
resolveExternals [ie]
setProperty ) [ie]The following (2nd level) properties can be set:
AllowDocumentFunction
ForcedResync
MaxXMLSize
NewParser
SelectionLanguage
SelectionNamespace
ServerHTTPRequest
for example: xmlDoc.setProperty("SelectionLanguage", "XPath");selection = xmlDoc.selectNodes("//Customer");
url [ie]
validateOnParse [ie]

Methods

abort [ie]
createAttribute
createCDATASection (data )
createComment (comment)
createDocumentFragment (data )
createElement (tagName)
createEntityReference (name )
createNode [ie] (type, name, nameSpaceURI)
createProcessingInstruction (target, data)
createTextNode (data)
getElementsByTagName (tagName)
load [ie] (url)
loadXML [ie] (xml_string)
nodeFromID [ie] (id_string)
save [ie] (objTarget)

For properties and methods of NODE object, visit the actual link: http://www.adp-gmbh.ch/web/js/msxmldom/methods_properties.html

Thursday, July 19, 2007

Create & Save an XML file using ASP

Create and Save an XML FileStoring data in XML files is useful if the data is to be sent to applications on non-Windows platforms. Remember that XML is portable across all platforms and the data will not need to be converted!
First we will learn how to create and save an XML file. The XML file below will be named "test.xml" and will be stored in the c directory on the server. We will use ASP and Microsoft's XMLDOM object to create and save the XML file:

'ASP CODE STARTS NOW
Dim xmlDoc, rootEl, child1, child2, p'Create an XML document
Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")'Create a root element and append it to the document
Set rootEl = xmlDoc.createElement("root")
xmlDoc.appendChild rootEl'Create and append child elements
Set child1 = xmlDoc.createElement("child1")
Set child2 = xmlDoc.createElement("child2")
rootEl.appendChild child1
rootEl.appendChild child2'Add an XML processing instruction
'and insert it before the root element
Set p=xmlDoc.createProcessingInstruction("xml","version='1.0'")
xmlDoc.insertBefore p,xmlDoc.childNodes(0)'Save the XML file to the c directory
xmlDoc.Save "c:\test.xml"
'ASP CODE ENDS HERE
For complete article, visit: http://www.w3schools.com/xml/xml_savedata.asp