Class: Msxml

Inherits:
Object
  • Object
show all
Includes:
WIN32OLE::VARIANT
Defined in:
sample/xml.rb

Overview

XMLDocument extends IXML Document. It is obsolete. You should use DOMDocument. This object should not be confused with the XMLDocument property on the XML data island.

Constant Summary

Constants included from WIN32OLE::VARIANT

WIN32OLE::VARIANT::VT_ARRAY, WIN32OLE::VARIANT::VT_BOOL, WIN32OLE::VARIANT::VT_BSTR, WIN32OLE::VARIANT::VT_BYREF, WIN32OLE::VARIANT::VT_CY, WIN32OLE::VARIANT::VT_DATE, WIN32OLE::VARIANT::VT_DISPATCH, WIN32OLE::VARIANT::VT_EMPTY, WIN32OLE::VARIANT::VT_ERROR, WIN32OLE::VARIANT::VT_I1, WIN32OLE::VARIANT::VT_I2, WIN32OLE::VARIANT::VT_I4, WIN32OLE::VARIANT::VT_I8, WIN32OLE::VARIANT::VT_INT, WIN32OLE::VARIANT::VT_NULL, WIN32OLE::VARIANT::VT_PTR, WIN32OLE::VARIANT::VT_R4, WIN32OLE::VARIANT::VT_R8, WIN32OLE::VARIANT::VT_UI1, WIN32OLE::VARIANT::VT_UI2, WIN32OLE::VARIANT::VT_UI4, WIN32OLE::VARIANT::VT_UI8, WIN32OLE::VARIANT::VT_UINT, WIN32OLE::VARIANT::VT_UNKNOWN, WIN32OLE::VARIANT::VT_USERDEFINED, WIN32OLE::VARIANT::VT_VARIANT

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj = nil) ⇒ Msxml

Returns a new instance of Msxml.



7206
7207
7208
7209
7210
7211
7212
7213
7214
# File 'sample/xml.rb', line 7206

def initialize(obj = nil)
  @clsid = "{CFC399AF-D876-11D0-9C10-00C04FC99C8E}"
  @progid = "Msxml"
  if obj.nil?
    @dispatch = WIN32OLE.new(@progid)
  else
    @dispatch = obj
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(cmd, *arg) ⇒ Object



7216
7217
7218
# File 'sample/xml.rb', line 7216

def method_missing(cmd, *arg)
  @dispatch.method_missing(cmd, *arg)
end

Instance Attribute Details

#clsidObject (readonly)

Returns the value of attribute clsid



7203
7204
7205
# File 'sample/xml.rb', line 7203

def clsid
  @clsid
end

#dispatchObject (readonly)

Returns the value of attribute dispatch



7202
7203
7204
# File 'sample/xml.rb', line 7202

def dispatch
  @dispatch
end

#lastargsObject (readonly)

Returns the value of attribute lastargs



7201
7202
7203
# File 'sample/xml.rb', line 7201

def lastargs
  @lastargs
end

#progidObject (readonly)

Returns the value of attribute progid



7204
7205
7206
# File 'sample/xml.rb', line 7204

def progid
  @progid
end

Instance Method Details

#asyncObject

HRESULT async get asynchronous loading flag.

BOOL arg0 --- pf [OUT]


7292
7293
7294
# File 'sample/xml.rb', line 7292

def async
  OLEProperty.new(@dispatch, 65649, [VT_BYREF|VT_BOOL], [VT_BYREF|VT_BOOL, VT_HRESULT])
end

#async=(arg0) ⇒ Object

HRESULT async get asynchronous loading flag.

BOOL arg0 --- pf [IN]


7241
7242
7243
7244
7245
# File 'sample/xml.rb', line 7241

def async=(arg0)
  ret = @dispatch._setproperty(65649, [arg0], [VT_BOOL, VT_HRESULT])
  @lastargs = WIN32OLE::ARGV
  ret
end

#charsetObject

HRESULT charset get encoding.

BSTR arg0 --- p [OUT]


7271
7272
7273
# File 'sample/xml.rb', line 7271

def charset
  OLEProperty.new(@dispatch, 65645, [VT_BYREF|VT_BSTR], [VT_BYREF|VT_BSTR, VT_HRESULT])
end

#charset=(arg0) ⇒ Object

HRESULT charset get encoding.

BSTR arg0 --- p [IN]


7232
7233
7234
7235
7236
# File 'sample/xml.rb', line 7232

def charset=(arg0)
  ret = @dispatch._setproperty(65645, [arg0], [VT_BSTR, VT_HRESULT])
  @lastargs = WIN32OLE::ARGV
  ret
end

#createElement(arg0, arg1 = nil, arg2 = nil) ⇒ Object

HRESULT createElement create different types of IXMLElements.

VARIANT arg0 --- vType [IN]
VARIANT arg1 --- var1 [IN]
IXMLElement2,IXMLElement2 arg2 --- ppElem [OUT]


7301
7302
7303
7304
7305
# File 'sample/xml.rb', line 7301

def createElement(arg0, arg1=nil, arg2=nil)
  ret = @dispatch._invoke(65644, [arg0, arg1, arg2], [VT_VARIANT, VT_VARIANT, VT_BYREF|VT_BYREF|VT_DISPATCH])
  @lastargs = WIN32OLE::ARGV
  ret
end

#doctypeObject

HRESULT doctype get document type.

BSTR arg0 --- p [OUT]


7285
7286
7287
# File 'sample/xml.rb', line 7285

def doctype
  OLEProperty.new(@dispatch, 65647, [VT_BYREF|VT_BSTR], [VT_BYREF|VT_BSTR, VT_HRESULT])
end

#readyStateObject

HRESULT readyState get ready state.

I4 arg0 --- pl [OUT]


7264
7265
7266
# File 'sample/xml.rb', line 7264

def readyState
  OLEProperty.new(@dispatch, 65643, [VT_BYREF|VT_I4], [VT_BYREF|VT_I4, VT_HRESULT])
end

#rootObject

HRESULT root get root IXMLElement of the XML document.

IXMLElement2,IXMLElement2 arg0 --- p [OUT]


7250
7251
7252
# File 'sample/xml.rb', line 7250

def root
  OLEProperty.new(@dispatch, 65637, [VT_BYREF|VT_BYREF|VT_DISPATCH], [VT_BYREF|VT_BYREF|VT_DISPATCH, VT_HRESULT])
end

#urlObject

HRESULT url set URL to load an XML document from the URL.

BSTR arg0 --- p [OUT]


7257
7258
7259
# File 'sample/xml.rb', line 7257

def url
  OLEProperty.new(@dispatch, 65641, [VT_BYREF|VT_BSTR], [VT_BYREF|VT_BSTR, VT_HRESULT])
end

#url=(arg0) ⇒ Object

HRESULT url set URL to load an XML document from the URL.

BSTR arg0 --- p [IN]


7223
7224
7225
7226
7227
# File 'sample/xml.rb', line 7223

def url=(arg0)
  ret = @dispatch._setproperty(65641, [arg0], [VT_BSTR, VT_HRESULT])
  @lastargs = WIN32OLE::ARGV
  ret
end

#versionObject

HRESULT version get XML version number.

BSTR arg0 --- p [OUT]


7278
7279
7280
# File 'sample/xml.rb', line 7278

def version
  OLEProperty.new(@dispatch, 65646, [VT_BYREF|VT_BSTR], [VT_BYREF|VT_BSTR, VT_HRESULT])
end