Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!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.090 X-Spam-Evidence: '*H*': 0.82; '*S*': 0.00; '8bit%:30': 0.09; 'attributes': 0.09; 'trying': 0.19; '>>>': 0.22; 'import': 0.22; 'print': 0.22; '>>>': 0.24; 'skip:e 30': 0.24; "i've": 0.25; 'skip:" 40': 0.26; 'tried': 0.27; 'idea': 0.28; 'xml': 0.29; 'skip:& 60': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; "skip:' 10": 0.31; '"",': 0.31; 'doc': 0.31; 'marc': 0.31; 'received:google.com': 0.35; 'doing': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'desperately': 0.84; 'skip:) 10': 0.84; 'xmlns:xsi': 0.84; 'imagine': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=5ENf9bZS2YZRDB8+5vvknIrv+FoXT1cBc5VS36NWyg4=; b=kUxIPWRuz96l+3ZmBtM6v+40CI/mQX8/wTzTano/wd27j4mTY7e7x4sSngySs9GGMM N+l95T7q6Upqdz0pULLMt665w2dpsiwnfFX0NkfprRHNSG1XDf4eMnDh0XBxK2ihVSpW +KYZOV8taO5ArRwf2Cc2pINVatoL66F1J7lMvgLg6YIe+hap0YLgHBt/Qt368sy3AnlK u9SP5r+rcEkos0chZLp3ONgexKVyr7TPXvyAFI+Y61UHFUMojeH8cf8jwr2resmYVLOw CNn70A65rrndRv+/uABmGU50ffqFWMz0vgiXj590dAcYOqbgAge95rqY+mFAmDLl3FYD l04w== X-Received: by 10.112.166.139 with SMTP id zg11mr4061671lbb.62.1406657977188; Tue, 29 Jul 2014 11:19:37 -0700 (PDT) MIME-Version: 1.0 From: Marc Aymerich Date: Tue, 29 Jul 2014 20:19:17 +0200 Subject: lxml and namespaces To: "comp.lang.python" Content-Type: multipart/alternative; boundary=001a113395bc0d073e04ff59157b 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: , Newsgroups: comp.lang.python Message-ID: Lines: 74 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406657979 news.xs4all.nl 2947 [2001:888:2000:d::a6]:48502 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75352 --001a113395bc0d073e04ff59157b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I'm desperately trying to construct an XML with the following document declaration: I'm using LXML, and what I'm doing is this >>> from lxml import etree >>> from lxml.builder import E >>> doc =3D E.Document( ... { ... 'xmlns': "urn:iso:std:iso:20022:tech:xsd:pain.008.001.02", ... '{xmlns}xsi': "http://www.w3.org/2001/XMLSchema-instance", ... } ... ) >>> print etree.tostring(doc) I've tried everything I can imagine and this is the best I can do :( Any idea on how to get the xmlns and xmlns:xsi attributes correctly? Thanks!! --=20 Marc --001a113395bc0d073e04ff59157b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi, I'm desperately trying to construct an XML with th= e following document declaration:

<Document xmln= s=3D=E2=80=9Durn:iso:std:iso:20022:tech:xsd:pain.008.001.02=E2=80=9D
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xmlns:xsi=3D=E2=80=9Dhttp://www.w3.org/2001/XMLSchema-instance=E2=80=9D>



I've tried everything I can imagine and this is the best I can do :(

Any idea on how to get the xmlns and xmlns:xsi attributes correctly?

Thanks!!

--
Marc
--001a113395bc0d073e04ff59157b--