473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

COM MX Session Instance to XML?

I am trying to connect to create an MX session using win32com tool and a file already written to create an MXSession. I want to be able to load a document off the server, and then manipulate it as if it were an XML document.

Everything goes through successfully when I enter the code, but it returns a COMObject MSXML.DOMDocument, and will not allow me to alter it as if it was an XML Doc (I assume because it's actually a COM Object instance?). Does anyone know what I can use to be able to get as an XML instance? (Please be specific, this is my second week using Python!)

Expand|Select|Wrap|Line Numbers
  1. from mx import MXSession
  2. mx = MXSession("tmsuat")
  3. myDoc = mx.loadDoc("official/system.config/global/tcwrules/ecnsalesdata")
  4. <COMObject MSXML.DOMDocument>
  5.  
Aug 18 '10 #1
4 1630
bvdet
2,851 Expert Mod 2GB
Did you check the objects for methods and attributes?
Expand|Select|Wrap|Line Numbers
  1. dir(myDoc)
Aug 18 '10 #2
I changed the bounding on the COM Object after reading about it, using the make_py function. It now looks like:

Expand|Select|Wrap|Line Numbers
  1. doc
  2. <win32com.gen_py.Microsoft XML, v2.6.IXMLDOMDocument2 instance at 0x13855200>
  3.  
when I do the dir on my new doc file, I get:

Expand|Select|Wrap|Line Numbers
  1. ['CLSID', '_ApplyTypes_', '__cmp__', '__doc__', '__getattr__', '__init__', '__module__', '__repr__', '__setattr__', '_get_goo
  2. d_object_', '_get_good_single_object_', '_oleobj_', '_prop_map_get_', '_prop_map_put_', 'abort', 'appendChild', 'cloneNode',
  3. 'coclass_clsid', 'createAttribute', 'createCDATASection', 'createComment', 'createDocumentFragment', 'createElement', 'create
  4. EntityReference', 'createNode', 'createProcessingInstruction', 'createTextNode', 'getElementsByTagName', 'getProperty', 'hasC
  5. hildNodes', 'insertBefore', 'load', 'loadXML', 'nodeFromID', 'removeChild', 'replaceChild', 'save', 'selectNodes', 'selectSin
  6. gleNode', 'setProperty', 'transformNode', 'transformNodeToObject', 'validate']
  7.  
I've checked out each of these options, but still cannot find a way to take out the string in the document. When using the getnodes, it returns "None" as having no nodes.
Aug 19 '10 #3
bvdet
2,851 Expert Mod 2GB
Is the file a valid XML document? I know little about win32com, and I understand even less. I have some experience with XML and xml.dom.minidom, but that may not help you.
Aug 19 '10 #4
xml.dom.minidom and other xml manipulation tools won't work on it by itself right now. it throws the error "document has no read method".

I am trying to load the document into a variable or something that would allow me to put those tools to use, but so far it's not working.

I am able to save it to the harddrive using the save() function, but unfortunately the data I am using would take months to save to a harddrive so I'm trying to do it another way.

Any help is appreciated!
Aug 25 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: kon george | last post by:
Can somebody assist. I build this code on a dev laptop and copied across the entire code to a Windows 2003 server with 1.1 framework. It is basic ASP.NE T that uses web service for SQL Server...
0
by: lapin | last post by:
I'm trying to get access to session variables from an IHttpHandler class. In several places I've seen the solution posted as in this message: >If you define your own custom HttpHandler, you need...
6
by: Gonenc Ercan | last post by:
Hi, I ve ended up debugging a ASP.NET project (with about 380 files on the project .NET Framework 1.0 on IIS 5.0) which has a memory leak... The memory rises too fast. With about 25-30 active...
2
by: Marek Vsechovsky | last post by:
I have an ASP.NET web application. From a couple of pages an ser can open a ..htm form to attach a picture using a web link. The user has the option to open another dialog window from the .htm form...
2
by: Markus Prediger | last post by:
Hi NG, I have an asp.net project that uses an vb6 com object for some database-manipulation (I cannot rewrite it in .net, sorry, its not my decision). I want it to be instanciated seperately...
11
by: syssyx | last post by:
I have a "CurrentUser" object in session that I want to access from each page of a vb.net website. I can successfully access everything if I include the following at the start of each pageload: ...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
3
by: Benton | last post by:
Hi there, Currently I have a rather simple class with a few members: string userName; string password; string centers; bool canModify; I have correspondant GET properties for them in the...
4
by: Don Miller | last post by:
I am using a Session variable to hold a class object between ASP.NET pages (in VB). In my constructor I check to see if the Session variable exists, and if it doesn't, I create one and populate it...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.