473,287 Members | 1,580 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,287 software developers and data experts.

new to python, looking for streams clues

Hello peoples,

As I said, I'm new to python, and particularly to XML generation in
python.
Using the 4suite XML package, I have been able to produce XML, but
only directly to STDOUT.

Refering to the 4suite markupWriter refrence, the class needs a stream
to output the generated XML, and if none is specified, it's the STDOUT
stream that is used.

What I would like, would be to store the generated XML into a python
object which implement the stream interface to be able to transform it
via XSLT if needed (it's in a web based project).

But, I've read the python doc for the last 12 hours without finding
anything about an existing object that implements that interface.
Am I missing something, or should I really create that object myself ?

I mean, I just need something that I can write into and read
thereafter.
It should already exists, no ?
Jun 27 '08 #1
3 801
Thierry wrote:
Hello peoples,

As I said, I'm new to python, and particularly to XML generation in
python.
Using the 4suite XML package, I have been able to produce XML, but
only directly to STDOUT.

Refering to the 4suite markupWriter refrence, the class needs a stream
to output the generated XML, and if none is specified, it's the STDOUT
stream that is used.

What I would like, would be to store the generated XML into a python
object which implement the stream interface to be able to transform it
via XSLT if needed (it's in a web based project).

But, I've read the python doc for the last 12 hours without finding
anything about an existing object that implements that interface.
Am I missing something, or should I really create that object myself ?

I mean, I just need something that I can write into and read
thereafter.
It should already exists, no ?
See the modules StringIO and cStringIO - which are mentioned on

http://docs.python.org/lib/lib.html

with the words:

4.5 StringIO -- Read and write strings as files

HTH,

Diez
Jun 27 '08 #2
Thierry a écrit :
Hello peoples,

As I said, I'm new to python, and particularly to XML generation in
python.
Using the 4suite XML package, I have been able to produce XML, but
only directly to STDOUT.

Refering to the 4suite markupWriter refrence, the class needs a stream
to output the generated XML, and if none is specified, it's the STDOUT
stream that is used.

What I would like, would be to store the generated XML into a python
object which implement the stream interface to be able to transform it
via XSLT if needed (it's in a web based project).

But, I've read the python doc for the last 12 hours without finding
anything about an existing object that implements that interface.
Am I missing something, or should I really create that object myself ?

I mean, I just need something that I can write into and read
thereafter.
It should already exists, no ?
It does, it's named StringIO (or cStringIO for the faster C
implementation), and it's part of the standard lib. AFAICT, it should
fit your needs.
Jun 27 '08 #3
On Jun 4, 1:50*pm, Bruno Desthuilliers <bruno.
42.desthuilli...@websiteburo.invalidwrote:
Thierry a écrit :
Hello peoples,
As I said, I'm new to python, and particularly to XML generation in
python.
Using the 4suite XML package, I have been able to produce XML, but
only directly to STDOUT.
Refering to the 4suite markupWriter refrence, the class needs a stream
to output the generated XML, and if none is specified, it's the STDOUT
stream that is used.
What I would like, would be to store the generated XML into a python
object which implement the stream interface to be able to transform it
via XSLT if needed (it's in a web based project).
But, I've read the python doc for the last 12 hours without finding
anything about an existing object that implements that interface.
Am I missing something, or should I really create that object myself ?
I mean, I just need something that I can write into and read
thereafter.
It should already exists, no ?

It does, it's named StringIO (or cStringIO for the faster C
implementation), and it's part of the standard lib. AFAICT, it should
fit your needs.
Thanks everyone.

I had seen it, but understood that you had to give it an already
existing string to operate on that one.
I feel a bit stupid. Time to get back to those lost sleep hours, I
presume.

But again, thanks everyone.
Jun 27 '08 #4

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

Similar topics

4
by: Carl | last post by:
Hi, I have this little code snippet that I use for recording audio streams. My problem is that I want to schedule my recordings with crontab. This does not work, however. I cannot figure out...
5
by: Cappy2112 | last post by:
I've just started a job which has a massive python2.3.4-centric tools installation and configuration. I know what you're going to say, but I can't upgrade and be the only one with a newer...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
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...

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.