Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #198005 > unrolled thread

XML in Pythong (was: Re: Postscript in 4tH)

Started byJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
First post2026-09-09 15:00 +0800
Last post2026-09-25 23:21 +0800
Articles 2 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  XML in Pythong (was: Re: Postscript in 4tH) Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-09-09 15:00 +0800
    Re: XML in Pythong Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-09-25 23:21 +0800

#198005 — XML in Pythong (was: Re: Postscript in 4tH)

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-09-09 15:00 +0800
SubjectXML in Pythong (was: Re: Postscript in 4tH)
Message-ID<iu7oS.240010$4yM7.67254@fx08.ams4>
On 09/09/2026 11:05 AM, Lawrence D’Oliveiro wrote:
> On Tue, 08 Sep 2026 22:38:58 -0300, Kragen Javier Sitaker wrote:
> 
>> PostScript does in fact have something like readmacros; in particular,
>> readhexstring was the recommended way to handle image data, so that the
>> image data didn’t have to be loaded into a PostScript object by way of
>> the PostScript parser.
> 
> It’s just a function. It’s like saying Python has “readmacros” because
> the JSON and XML library modules have functions for reading input
> streams and returning language-object representations of those
> structures.
> 
Dear Lawrence,

Ok, so I was tempted to ask why you're bringing up Python in a Post-
Script discussion, but then I remembered you're a /Pythong influencer/,
and can not help yourself.

Now, why are there only two library modules in Python for this task?  In
C, we have -- I believe -- several, but I've only used Expat precisely
because it doesn't create language-objects for me.  Do you not have a
stream oriented XML parser in Pythong?  Is Python that much inferiour
to C?

The same question can be asked of JSON, because sometimes we don't want
to download the whole payload before starting the parse process.  After
all, why not just shut down the network connection when we detect garb-
age, like the one Lawrence is constantly spewing all over Usenet?


Best wishes, and happy XML, JSON parsing in alt.folklore.computers!


I've set the follow-up to: alt.folklore.computers, comp.lang.python,
comp.lang.xml, borland.public.xml in that order.  Please remove
alt.folklore.computers if you think it's not relevant anymore.
-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

[toc] | [next] | [standalone]


#198066 — Re: XML in Pythong

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-09-25 23:21 +0800
SubjectRe: XML in Pythong
Message-ID<0kwtS.229029$RI1.97264@fx04.ams4>
In reply to#198005
On 9/9/2026 3:00 PM, Johann 'Myrkraverk' Oskarsson wrote:
> On 09/09/2026 11:05 AM, Lawrence D’Oliveiro wrote:
>> On Tue, 08 Sep 2026 22:38:58 -0300, Kragen Javier Sitaker wrote:
>>
>>> PostScript does in fact have something like readmacros; in particular,
>>> readhexstring was the recommended way to handle image data, so that the
>>> image data didn’t have to be loaded into a PostScript object by way of
>>> the PostScript parser.
>>
>> It’s just a function. It’s like saying Python has “readmacros” because
>> the JSON and XML library modules have functions for reading input
>> streams and returning language-object representations of those
>> structures.
>>
> Dear Lawrence,
> 
> Ok, so I was tempted to ask why you're bringing up Python in a Post-
> Script discussion, but then I remembered you're a /Pythong influencer/,
> and can not help yourself.
> 
> Now, why are there only two library modules in Python for this task?  In
> C, we have -- I believe -- several, but I've only used Expat precisely
> because it doesn't create language-objects for me.  Do you not have a
> stream oriented XML parser in Pythong?  Is Python that much inferiour
> to C?
> 
> The same question can be asked of JSON, because sometimes we don't want
> to download the whole payload before starting the parse process.  After
> all, why not just shut down the network connection when we detect garb-
> age, like the one Lawrence is constantly spewing all over Usenet?
> 
> 
> Best wishes, and happy XML, JSON parsing in alt.folklore.computers!
> 
> 
> I've set the follow-up to: alt.folklore.computers, comp.lang.python,
> comp.lang.xml, borland.public.xml in that order.  Please remove
> alt.folklore.computers if you think it's not relevant anymore.

I have now experimented with Expat in Python.  It's as simple as

   import xml.parsers.expat

and

   p = xml.parsers.expat.ParserCreate()

which works wonderfully to explore the internals of an S.V.G. graphical
image.


Happy S.V.G. in Python!
-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;
Federated at https://fed.brid.gy/bsky/myrkraverk.bsky.social

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web