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.



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

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



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

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

Instance Attribute Details

#clsidObject (readonly)

Returns the value of attribute clsid.



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

def clsid
  @clsid
end

#dispatchObject (readonly)

Returns the value of attribute dispatch.



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

def dispatch
  @dispatch
end

#lastargsObject (readonly)

Returns the value of attribute lastargs.



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

def lastargs
  @lastargs
end

#progidObject (readonly)

Returns the value of attribute progid.



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

def progid
  @progid
end

Instance Method Details

#asyncObject

HRESULT async get asynchronous loading flag.

BOOL arg0 --- pf [OUT]


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

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]


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

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]


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

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]


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

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]


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

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]


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

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]


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

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]


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

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]


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

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]


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

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]


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

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