Skip to main content
13 votes

xml is XML is xml is XML

Naming There are .NET Naming Guidelines which state that methods should be named using PascalCase casing. You haven't done this for ...
Heslacher's user avatar
  • 51k
8 votes
Accepted

xml is XML is xml is XML

One should also add that: Both the ReturnNameAsString and the buildString methods could be ...
t3chb0t's user avatar
  • 44.7k
7 votes
Accepted

Getting information about music that is popular in a country

Imports First, let me suggest you look at the PEP 8 style guide. I don't follow all of the suggestions myself, but some of them make good sense, including the suggestions on the arrangement and ...
aghast's user avatar
  • 12.6k
7 votes

XML design for parsing in C#

You are trying to recreate functionality that is already provided out of the box. Reference Configure an ASP.NET Core App From documentation it supports providers for INI, JSON, and XML. Each ...
Nkosi's user avatar
  • 3,296
5 votes
Accepted

Using QXmlStreamReader to read configuration file of key-value pairs

Case for not using a class It's not clear to me whether you need a class for what you are doing. Unless you need to be able to construct an instance of ...
R Sahu's user avatar
  • 3,572
5 votes

Deserialize, Copy and Merge Orders from XML to C#

Naming var orders = new List<XElement>(); var _orders = new List<Order>(); First, according to the C# naming convention, you should never have ...
IEatBagels's user avatar
  • 12.7k
5 votes
Accepted

Python CSV to XML converter

The real issue with repeating yourself here is that you are iterating over your dataframe twice when you don't have to. Fortunately, the devs for lxml make the ...
C.Nivs's user avatar
  • 3,117
5 votes

Reading Data from XML and storing them into SQL Database

Review Single responsibility principle Method save_vendor_info (which we'll rename later) does data retrieval from an external source, xml to db mapping, and SQL ...
dfhwze's user avatar
  • 14.2k
5 votes

Reading Data from XML and storing them into SQL Database

As dfhwze says, you should probably pull in the connection string/information from an external source: the production database hopefully won't be called 'TEST', which means you can't use this code in ...
VisualMelon's user avatar
  • 7,591
5 votes
Accepted

Performance - Read large amount of XMLs and load into single csv

TLDR: it can be done much more quickly and much more concisely, in 28 minutes end-to-end, and in 12 minutes when all XML are already on disk. The key trick: using the long rather than wide format for ...
TemplateRex's user avatar
  • 1,938
5 votes
Accepted

XML attribute analysis

Regarding the primary question, your code is very close to being a well-defined function. Simply wrap the entire code in a function, making filename the right ...
Salim's user avatar
  • 66
5 votes

Format potentially invalid XML

There's a test suite of 2000 test cases available at https://www.w3.org/XML/Test/ - try it out. From a quick glance, it's not clear to me how you're handling content within comments or CDATA sections -...
Michael Kay's user avatar
5 votes
Accepted

Translate SOAP response into a CSV using Python

It makes little sense to slice the data into "vertical" lists, then transpose them back into rows using zip(). Not only is it cumbersome to do it that ...
200_success's user avatar
5 votes
Accepted

Simple XML string to user-friendly plain text converter method in Java

Proper Naming The name XMLProcessing is a bit vague, doesn't communicate the responsibility well. Because the meaning of the verb "processing" is very ...
Alexander Ivanchenko's user avatar
4 votes

Proxy/Wrapper class for a dynamic object from a SOAP API

this.BasketResponse = new SoapSimplifier(basketResponse).ToJObject(); At this point you know you have a JObject: by ...
Peter Taylor's user avatar
  • 24.5k
4 votes

Refactor nested null checking for multiple possible string values

You can just go with : ...
Guillaume Beauvois's user avatar
4 votes

Parse atom RSS feed with xml.dom.minidom

Nope, nope, nope. feed = type('Feed', (object,), {}) feed.entries.append(type('Entry', (feed,), entry_dict)) The entire point of OOP is to have pre-defined classes,...
Chris Warrick's user avatar
4 votes
Accepted

Mini game for android

String str = parent.getItemAtPosition(pos).toString(); What does str mean? You proceed to use it to determine the level (i....
Dair's user avatar
  • 6,220
4 votes

Getting information about music that is popular in a country

Some of the things we can do to improve performance: install lxml and replace import xml.etree.ElementTree as ET with: ...
alecxe's user avatar
  • 17.5k
4 votes
Accepted

Get a XElement at a given path

You could try the following which utilizes XPath's XPathSelectElement extension method. test.xml ...
Ryan H.'s user avatar
  • 246
4 votes

Get attribute values with LINQ to XML

If you don't want create a full-blown xml serializer (I wouldn't if it was a simple as that) all you can do is to just tide this up. This is, add a helper variable ...
t3chb0t's user avatar
  • 44.7k
4 votes
Accepted

Rendering the AuthorName using the DOMParser to read XML

Style Inconsistent use of line ending semi colon Undeclared variables parser and xmlDoc Unused code. ...
Blindman67's user avatar
  • 22.9k
4 votes

Slow parsing of mutiple XML files to CSV

An easy speed-up is not using a global object that you continually modify. This is especially important since you also save the output file over and over, which is completely unnecessary (unless you ...
Graipher's user avatar
  • 41.7k
4 votes

File size when parsing XML

At this point your code is starting to become hard to follow. If you add any more complicated logic, you will not be able to easily understand it yourself if you return to it a few weeks later. I ...
Graipher's user avatar
  • 41.7k
4 votes

Make my XML Parser in Java using WoodStox run faster and use less memory, or just generally better

I have some suggestion for the code, that will not make to code faster, but cleaner, in my opinion. You can use the try-with-resources to handle the closing of the ...
Doi9t's user avatar
  • 3,374
4 votes

Make my XML Parser in Java using WoodStox run faster and use less memory, or just generally better

I was somewhat curious if Woodstox has improved, so I wrote a complete parser for your example data. It's in a different style than your code, complete repo: https://github.com/chhh/testing-woodstox-...
Dmitry Avtonomov's user avatar
4 votes
Accepted

Parse XML data and update values of each node's children

If you would define a model like this: ...
Peter Csala's user avatar
  • 10.8k
4 votes
Accepted

Parsing an XML tree of categories

You can start by just extracting the bit that clearly is repeated into a standalone function: ...
ades's user avatar
  • 1,391
4 votes
Accepted

Retrieve data from an XML file in Java

Well, there's a problem here, which is that your question is being read here by people who know the subject far better than your assessors; so you're not actually asking for what the experts consider ...
Michael Kay's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible