Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The "cutting edge" is getting rather dull. -- Andy Purshottam


devel / comp.lang.python / Re: lxml empty versus self closed tag

SubjectAuthor
o Re: lxml empty versus self closed tagDieter Maurer

1
Re: lxml empty versus self closed tag

<mailman.102.1646248795.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17277&group=comp.lang.python#17277

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: die...@handshake.de (Dieter Maurer)
Newsgroups: comp.lang.python
Subject: Re: lxml empty versus self closed tag
Date: Wed, 2 Mar 2022 19:39:24 +0100
Lines: 17
Message-ID: <mailman.102.1646248795.2329.python-list@python.org>
References: <23c68bd2-2d86-8be6-e1e3-e6c6acc74db3@everest.reportlab.co.uk>
<25119.47580.635071.641702@ixdm.fritz.box>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 0BhJykUwVXtw1D4Dx0FMXwmyJIr6dh0QlHi1QwfivhgA==
Return-Path: <dieter@handshake.de>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'library.': 0.05;
'influence': 0.07; '>from': 0.09; 'binding': 0.09; 'cases.': 0.09;
'cc:addr:python-list': 0.09; 'cc:no real name:2**0': 0.14;
'becker': 0.16; 'parsing': 0.16; 'robin': 0.16; 'python': 0.16;
'cc:addr:python.org': 0.20; 'received:de': 0.23; 'cc:2**0': 0.25;
'done': 0.28; 'seem': 0.31; 'think': 0.32; 'there': 0.33; 'header
:In-Reply-To:1': 0.34; 'using': 0.37; 'way': 0.38; 'least': 0.39;
'wrote': 0.39; 'both': 0.40; 'header:Received:6': 0.67;
'received:88': 0.84
In-Reply-To: <23c68bd2-2d86-8be6-e1e3-e6c6acc74db3@everest.reportlab.co.uk>
X-Mailer: VM 8.0.12-devo-585 under 21.4 (patch 24) "Standard C" XEmacs Lucid
(x86_64-linux-gnu)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <25119.47580.635071.641702@ixdm.fritz.box>
X-Mailman-Original-References: <23c68bd2-2d86-8be6-e1e3-e6c6acc74db3@everest.reportlab.co.uk>
 by: Dieter Maurer - Wed, 2 Mar 2022 18:39 UTC

Robin Becker wrote at 2022-3-2 15:32 +0000:
>I'm using lxml.etree.XMLParser and would like to distinguish
>
><tag></tag>
>
>from
>
><tag/>
>
>I seem to have e.getchildren()==[] and e.text==None for both cases. Is there a way to get the first to have e.text==''

I do not think so (at least not without a DTD):
`<tag/>' is just a shorthand notation for '<tag></tag>' and
the difference has no influence on the DOM.

Note that `lxml` is just a Python binding for `libxml2`.
All the parsing is done by this library.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor