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: 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: 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> 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: 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 Il giorno marted=EC 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 the= re so I will repost here. >=20 > > >=20 > > I am new to xml processing in python. >=20 > > I am looking to create XML. Xml is not too difficult so I thought to cr= eate it manually using ElementTree. >=20 > > First I noted that ET.toString does escape <>& but not " and ' >=20 > > Is that normal? >=20 > > >=20 > " needs to be encoded when it's in an attribute's value: >=20 >=20 >=20 > OK I understood. =20 >=20 >=20 > because it's also being used as a delimiter in that case, but elsewhere >=20 > it has no special meaning. >=20 >=20 >=20 > > 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). >=20 >=20 >=20 > XML with the escaping isn't valid XML. >=20 Of course I know it is not valid without escaping. But I need it only for s= igning. I will recheck this if really the web service wants the data to be = signed as non escaped. =20 Thanks Nenad