Path: csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:text': 0.04; 'xml,': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'semantics': 0.09; 'specifying': 0.09; 'subject:keys': 0.09; 'ignore': 0.14; 'applies': 0.15; 'csv': 0.16; 'different,': 0.16; 'formats.': 0.16; 'from:addr:behnel.de': 0.16; 'from:addr:stefan_ml': 0.16; 'from:name:stefan behnel': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject: \n ': 0.16; 'subject:CSV': 0.16; 'subject:XML': 0.16; 'subject:headers': 0.16; 'subject:values': 0.16; 'unordered': 0.16; 'attribute': 0.18; 'stefan': 0.18; 'trying': 0.22; 'assign': 0.22; 'subject:will': 0.22; 'defined': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'define': 0.27; 'xml': 0.27; 'sequence': 0.27; "doesn't": 0.28; 'document,': 0.29; 'subject:that': 0.29; 'subject:) ': 0.32; 'changing': 0.34; 'to:addr:python-list': 0.35; 'formats': 0.35; 'but': 0.36; 'list,': 0.36; 'there': 0.36; 'data.': 0.36; 'subject:" ': 0.36; 'subject:: ': 0.37; 'received:org': 0.38; 'is,': 0.38; 'mean': 0.38; 'to:addr:python.org': 0.39; 'data': 0.40; 'subject:with': 0.40; 'received:de': 0.40; 'subject: (': 0.40; 'different': 0.64; 'choose': 0.68; 'obvious': 0.72; 'denis': 0.84; 'hand.': 0.84; 'subject:write': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Stefan Behnel Subject: Re: enumerate XML tags (keys that will become headers) along with text (values) and write to CSV in one row (as opposed to "stacked" values with one header) Date: Sun, 28 Jun 2015 09:46:36 +0200 References: <14aeae7a-41ab-4619-8331-7995e2420e54@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: ipservice-092-217-127-171.092.217.pools.vodafone-ip.de User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1435477605 news.xs4all.nl 2880 [2001:888:2000:d::a6]:53555 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93269 Denis McMahon schrieb am 26.06.2015 um 09:44: > xml data is an unordered list, and are trying to assign an order to it. > > If the xml data was ordered, either each tag would be different, or each > tag would have an attribute specifying a sequence number. XML is not unordered. The document order is well defined and entirely obvious from the data. Whether this order is relevant and has a meaning or not is, however, not part of XML itself but is left to the semantics of the specific document format at hand. Meaning, XML document formats can choose to ignore that order and define it as irrelevant. That doesn't mean it's not there for a given document, but it may mean that a re-transmission of the same document would be allowed to use a different order without changing the information. This property applies to pretty much all structured data formats and not just XML, by the way, also to CSV and other tabular formats. Stefan