473,320 Members | 2,202 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,320 software developers and data experts.

Python & DOM

Hi !

I need to create a XML document using DOM. How do I set the element value,
after creating it with 'createElement' ? Documentation states that there
is a 'read-only' 'nodeValue' variable. I don't know what means 'read-only
variable' in Python, but the fact is that setting that variable does not
help.

Java DOM API has 'setNodeValue' method. Is there anything corresponding in
Python DOM ?

DG

Jul 19 '05 #1
2 1647
textNode = yourDocumentElement.createTextNode("the content")
yourElement.appendChild(textNode)

/S

Jul 19 '05 #2
On Mon, 23 May 2005 22:37:09 -0700, si*************@gmail.com wrote:
textNode = yourDocumentElement.createTextNode("the content")
yourElement.appendChild(textNode)

Thanks, it works, but 'yourDocumentElement' needs to be of type
'document'. The name leads to conclusion that it needs to be
a root element of the document.

DG
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: james blair | last post by:
Hi I have a search page & the reults for the search are fetched from the database. I want that on the results page only first 25 results are shown & a link "next 25 results" be shown.Same for the...
2
by: . | last post by:
Hi, how can I build python modules on windows? I tried to build numarray using Microsoft Visual C++ 2003 Toolkit, but got the following error: --- error: Python was built with version 7.1 of...
3
by: John Nagle | last post by:
Here's a URL from a link on the home page of a major company. <a href="/adsk/servlet/index?siteID=123112&amp;id=1860142">About Us</a> Yes, that "&amp;" is in the source text of the page. This is, in...
8
by: js | last post by:
Hi list. If I'm not mistaken, in python, there's no standard library to convert html entities, like &amp; or &gt; into their applicable characters. htmlentitydefs provides maps that helps this...
0
by: OldManRiver | last post by:
All, I downloaded the OpenEMM (Linux & Windows) to install. The Windows version uses Python as the Installer and the programmer for this installer made some bad assumptions about the...
4
by: Jive Dadson | last post by:
Hey folks. I know approximately zero about web clients. There's a simple task I want to do. (I think it's probably simple.) And I figure a Python script ought to be just the ticket. Various...
3
by: bsagert | last post by:
Some web feeds use decimal character entities that seem to confuse Python (or me). For example, the string "doesn't" may be coded as "doesn’t" which should produce a right leaning apostrophe....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.