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


Groups > comp.lang.python > #89956

Re: Is it normal to cry when given XML?

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <awilliam@whitemice.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'url:sourceforge': 0.03; 'xml,': 0.05; 'automate': 0.07; 'great.': 0.07; 'wrong,': 0.09; 'xml.': 0.09; 'python': 0.11; 'random': 0.14; 'adam': 0.16; 'from:addr:awilliam': 0.16; 'from:addr:whitemice.org': 0.16; 'from:name:adam tauno williams': 0.16; 'given,': 0.16; 'gpg': 0.16; 'missing?': 0.16; 'rarely': 0.16; 'receive.': 0.16; 'received:72.14.190': 0.16; 'received:72.14.190.87': 0.16; 'received:mail.wmmi.net': 0.16; 'received:wmmi.net': 0.16; 'reply- to:addr:awilliam': 0.16; 'reply-to:addr:whitemice.org': 0.16; "someone's": 0.16; 'subject:XML': 0.16; 'subject:when': 0.16; 'url:py': 0.16; 'xslt,': 0.16; 'all.': 0.16; 'so.': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'developer,': 0.19; 'url:default': 0.19; 'club': 0.24; 'stick': 0.24; 'williams': 0.24; 'file.': 0.24; 'push': 0.26; 'tables': 0.26; 'header:In-Reply-To:1': 0.27; 'url:code': 0.29; 'xml': 0.29; 'database,': 0.30; 'work.': 0.31; 'usually': 0.31; '-0700,': 0.31; 'file': 0.32; 'text': 0.33; 'everyone': 0.33; 'checking': 0.33; 'received:72.14': 0.33; 'maybe': 0.34; 'basic': 0.35; 'problem.': 0.35; 'no,': 0.35; 'operations': 0.35; 'usual': 0.35; 'there': 0.35; 'largely': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'wrong': 0.37; 'received:10': 0.37; 'easily': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'easy': 0.60; 'most': 0.60; 'entire': 0.61; 'simple': 0.61; 'url:p': 0.64; 'provide': 0.64; 'header:Reply-To:1': 0.67; 'normal.': 0.68; 'wish': 0.70; 'reply-to:no real name:2**0': 0.71; 'walk': 0.74; 'goal': 0.75; 'abc': 0.84; 'fast,': 0.84; 'suppliers': 0.84; 'url:actions': 0.84; 'xslt': 0.84; 'reliable,': 0.93; 'ultimate': 0.93
Subject Re: Is it normal to cry when given XML?
From Adam Tauno Williams <awilliam@whitemice.org>
Reply-To awilliam@whitemice.org
To python-list@python.org
Date Tue, 05 May 2015 06:20:28 -0400
In-Reply-To <d429abb8-2b17-4235-9eea-27a9a6f1ec9f@googlegroups.com>
References <d429abb8-2b17-4235-9eea-27a9a6f1ec9f@googlegroups.com>
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAAA3NCSVQICAjb4U/gAAAJjElEQVRYw70Za0gUXXvmrLraqmmmpmVt2IWUlSLIyhATDLt4CRLqR1lUWJSFIdHNhEgsNwwl0TDLLBBLKUOlqNTUvBKUlZaXvLSVqK0puro7c2a+H0/f6bwzs5vv9+N7fogz+5znPPfbsIIgMDZBFMWcnBy1Wn348GHm/wCiKIqiKAiCqAQY48bGRjs7u6SkJI7jxL+BIAhAyhpBOb7kjZ0oiizLAnOCIPA8jxBSqVQsywJ2eno6xrirqwshJIoikYRlWfqRBkEQ4DihbANf+hJjLPwXMMZms9lsNgMrPM8XFRWpVCqGYdzc3CYnJwkmUQZ5BHXaQCBo9D9wKa0whpyZmJjgOI6m0tHR4ezsTORLSUnheV7xPgnQ9/1bfIbGlmjr1KlToB4AtVo9NDQkp06fsnafbc3RRBCxIsuytMl//fpVVFSEMSZvLBZLYWEhSEMbnT6l6Bb0o7Wf/hCRmxke8/LyJDexLOvj46NoNYmNFH0F/pF4jByfkXucIAgWiyU4OFgxgm7duiVnQi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vr6xMREKAuKa56SkhL6jZubm+0FAb1ytbarVAj+OXPmQL7q6+tTqVQ+Pj7d3d3ytWtNTQ0dYgzDpKamKq4irO2H/jT5er3e3t7eBls5OTnQM5WUlLi4uHh4eOzatSsvL+/FixfNzc2lpaVHjhyhvQegtLRU+J+AEQShtbV106ZNdHBKisP3799hts/NzbVWQ2hzeHl5gV7lKynFXZb CFtZoNK5 du9YaT1u2bCGpaPv27fQQomhoGPVnuQZV0BDcND09nZ6e7uzsLNcBQujRo0dQCvr6+uLi4qzxBIlYsl6e/b72zxgELHMcNzo6GhYWJr8pPDwcchLGmOM4MlJJwNvb22Aw0Nlr9p8ZAFSpqam0JpycnHbu3BkYGGg2m7u7u8lPBoMBYxwaGooQQgitW7cuKirK09NzZmaGZVmMsU6nS0hIuHv3rqenJ2362YY0+fYgF4KoNz8/38PDgxRUhFBNTY3ikhXqkbVvMXJ8az4uiiKruNUmX154nm9sbGxqamptbe3s7PT396+oqAAFSA4SzwNB6U8t8JP8keDQyP8BCciofEZhq20AAAAASUVORK5CYII=
Content-Type text/plain; charset="ISO-8859-1"
X-Mailer Evolution 3.12.11
Mime-Version 1.0
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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 <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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.122.1430822460.12865.python-list@python.org> (permalink)
Lines 61
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1430822460 news.xs4all.nl 2907 [2001:888:2000:d::a6]:54709
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:89956

Show key headers only | View raw


On Tue, 2015-05-05 at 02:28 -0700, Sayth Renshaw wrote:
> Just checking if the reaction to cry when given XML is normal. 

No, not at all.  I leap for ecstatic joy when given, as all to rarely
happens, XML.  Rather than someone's turdy text [which includes JSON]
file.  I wish all 1,200+ of my vendors and suppliers would provide their
data in XML rather than the random swirl of bizarre crap I receive.

> I thought maybe I am approaching it all wrong, using lxml largely or 
> some xquery to club it into submission. 

I do most of my processing with LXML, XSLT, and XPath.  Fast, efficient,
reliable, works great.  And it is easy to abstract these tools to
automate what I need to do over and over again.

> See the usual goal is just to take the entire XML and push it into a
> database. 

I do a lot of pushing into an SQL database, no problem.  XSLT does 99.4%
of the work.

> See its never basic xml, 

"basic xml"? 

> usually comes from some database with a walk of tables and strange relationships.

No problem.

> Am I doing it wrong is there a simple way I am missing? 

I suspect so.  Data is easily transformed into

<ResultSet table="xyz">
  <row>
    <field1 dataType="string" isNull="false"
isPrimaryKey="true">abc</field1>
    <field2 dataType="string" isNull="true" isPrimaryKey="false"/>
    <field3 dataType="string" isNull="false"
isPrimaryKey="false">stanley</field1>
  </row>
 ...
</ResultSet>

And then that data can be processes as SQL insert/update/delete/upsert
operations while being swung around on the end of a stick while you
dance.

<https://sourceforge.net/p/coils/code/ci/default/tree/coils/logic/workflow/actions/sql/upsert.py>

XML is the ultimate file "format".  It solves problems, much better than
everyone trying to re-engineer their needs INTO a format [like JSON].





-- 
Adam Tauno Williams <mailto:awilliam@whitemice.org> GPG D95ED383
Systems Administrator, Python Developer, LPI / NCLA

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


Thread

Is it normal to cry when given XML? Sayth Renshaw <flebber.crue@gmail.com> - 2015-05-05 02:28 -0700
  Re: Is it normal to cry when given XML? Chris Angelico <rosuav@gmail.com> - 2015-05-05 19:44 +1000
  Re: Is it normal to cry when given XML? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-05 20:04 +1000
  Re: Is it normal to cry when given XML? Adam Tauno Williams <awilliam@whitemice.org> - 2015-05-05 06:20 -0400
    Re: Is it normal to cry when given XML? Sayth Renshaw <flebber.crue@gmail.com> - 2015-05-05 05:03 -0700
  Re: Is it normal to cry when given XML? Tim <jtim.arnold@gmail.com> - 2015-05-05 06:05 -0700
  Re: Is it normal to cry when given XML? Michael Torrie <torriem@gmail.com> - 2015-05-05 10:54 -0600
  Re: Is it normal to cry when given XML? Grant Edwards <invalid@invalid.invalid> - 2015-05-05 16:58 +0000
    Re: Is it normal to cry when given XML? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-05-05 21:03 -0400
  Re: Is it normal to cry when given XML? Emile van Sebille <emile@fenx.com> - 2015-05-05 16:04 -0700
  Re: Is it normal to cry when given XML? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-06 00:35 +0100
  Re: Is it normal to cry when given XML? Chris Angelico <rosuav@gmail.com> - 2015-05-06 10:07 +1000
    Re: Is it normal to cry when given XML? Rustom Mody <rustompmody@gmail.com> - 2015-05-05 17:19 -0700
      Re: Is it normal to cry when given XML? Chris Angelico <rosuav@gmail.com> - 2015-05-06 10:29 +1000

csiph-web