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


Groups > comp.lang.python > #34674

Re: Create xml with elementtree ET and xml escaping

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <nenad.cikic@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'encoded': 0.05; 'mrab': 0.05; 'escape': 0.07; 'delimiter': 0.09; 'subject:xml': 0.09; 'to:addr:comp.lang.python': 0.09; 'xml.': 0.09; 'cc:addr:python-list': 0.10; 'value:': 0.16; 'noted': 0.22; 'posted': 0.22; 'cc:2**0': 0.23; 'seems': 0.23; 'cc:no real name:2**0': 0.24; 'non': 0.24; 'signed': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'case,': 0.29; 'received:google.com': 0.34; 'thanks': 0.34; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'really': 0.36; 'ability': 0.36; 'but': 0.36; 'subject:with': 0.36; 'too': 0.36; 'xml': 0.37; 'does': 0.37; 'being': 0.37; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'hello,': 0.39; 'from:no real name:2**0': 0.60; 'first': 0.61; 'dead': 0.62; 'special': 0.73; 'escaping': 0.84; 'understood.': 0.84
Newsgroups comp.lang.python
Date Tue, 11 Dec 2012 18:19:22 -0800 (PST)
In-Reply-To <mailman.740.1355256000.29569.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=78.0.101.60; posting-account=zQWumAoAAACkh-pqYRlylHLsySaaTgxt
References <7caeb6db-41f9-4321-b172-f8ddb6a9ac6d@googlegroups.com> <mailman.740.1355256000.29569.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-IP 78.0.101.60
MIME-Version 1.0
Subject Re: Create xml with elementtree ET and xml escaping
From nenad.cikic@gmail.com
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.763.1355278772.29569.python-list@python.org> (permalink)
Lines 48
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355278772 news.xs4all.nl 6840 [2001:888:2000:d::a6]:53988
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:34674

Show key headers only | View raw


Il giorno martedì 11 dicembre 2012 20:59:54 UTC+1, MRAB ha scritto:
> > Hello, I have posted the same in XML group but it seems pretty dead there so I will repost here.
> 
> >
> 
> > I am new to xml processing in python.
> 
> > I am looking to create XML. Xml is not too difficult so I thought to create it manually using ElementTree.
> 
> > First I noted that ET.toString does escape <>& but not " and '
> 
> > Is that normal?
> 
> >
> 
> " needs to be encoded when it's in an attribute's value:
> 
> 
> 
>      <tag value="a quote (&quot;)">


OK I understood.
 
> 
> 
> because it's also being used as a delimiter in that case, but elsewhere
> 
> it has no special meaning.
> 
> 
> 
> > Since I have also the need to sign the XML I need the ability to create xml but without xml escaping (unescaped data are signed).
> 
> 
> 
> XML with the escaping isn't valid XML.
> 

Of course I know it is not valid without escaping. But I need it only for signing. I will recheck this if really the web service wants the data to be signed as non escaped.
 
Thanks
Nenad

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Create xml with elementtree ET and xml escaping nenad.cikic@gmail.com - 2012-12-11 09:47 -0800
  Re: Create xml with elementtree ET and xml escaping MRAB <python@mrabarnett.plus.com> - 2012-12-11 19:59 +0000
    Re: Create xml with elementtree ET and xml escaping nenad.cikic@gmail.com - 2012-12-11 18:19 -0800
      Re: Create xml with elementtree ET and xml escaping Stefan Behnel <stefan_ml@behnel.de> - 2012-12-15 10:31 +0100
    Re: Create xml with elementtree ET and xml escaping nenad.cikic@gmail.com - 2012-12-11 18:19 -0800

csiph-web