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 ...
8
votes
Accepted
xml is XML is xml is XML
One should also add that:
Both the ReturnNameAsString and the buildString methods could be ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 -...
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 ...
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 ...
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 ...
4
votes
Refactor nested null checking for multiple possible string values
You can just go with :
...
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,...
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....
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:
...
4
votes
Accepted
Get a XElement at a given path
You could try the following which utilizes XPath's XPathSelectElement extension method.
test.xml
...
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 ...
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. ...
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 ...
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 ...
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 ...
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-...
4
votes
Accepted
Parse XML data and update values of each node's children
If you would define a model like this:
...
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:
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
xml × 431c# × 116
python × 86
java × 72
parsing × 67
performance × 37
php × 32
beginner × 29
android × 28
linq × 22
python-3.x × 21
javascript × 17
object-oriented × 17
c++ × 16
dom × 13
xslt × 13
.net × 12
json × 12
csv × 12
serialization × 11
strings × 10
sql × 10
ruby × 9
regex × 9
layout × 9