Questions tagged [xml]
Extensible Markup Language (XML) is a structured document format that defines human- and machine-readable encoding rules.
439
questions
7
votes
1
answer
9k
views
Convert elementtree to dict
Just needed a quick way to convert an elementtree element to a dict. I don't care if attributes/elements clash in name, nor namespaces. The XML files are small enough. If an element has multiple ...
7
votes
2
answers
481
views
Fluent Interface for a XmlQueryBuilder
In this answer I suggested using a fluent interface "builder" to replace all the hard-coded, repetitive and quite error-prone inline XML string concatenations.
This code might need a bit of tweaking ...
7
votes
3
answers
4k
views
Google Weather API wrapper
I'm an amateur programmer (self-taught). Anyway, this class provides a few methods to access Google's unofficial weather API. I'm having trouble on how to go about handling parsing errors in ...
7
votes
1
answer
29k
views
Dividing the screen in two halves using LinearLayout
I want to divide the screen in two halves. The layout is locked on portrait mode. The top half will have one button and the bottom half will have many buttons. That's why I choose this division, since ...
7
votes
2
answers
605
views
Generating code with XML
I'm working on my graduate project and I had stumbled upon a somewhat dilemma, I've managed to solve it with some workarounds but I have my doubts that this is the most efficient way to deal with this ...
7
votes
1
answer
466
views
Android Compound View Usage
I have 2 buttons for Terms and Conditions in my project, that I need to implement in multiple activities. I created the following class:
...
7
votes
1
answer
1k
views
Importing XML dump of Stack Overflow questions and answers into SQLite3
I have a 60gb+ XML file and, as you can see, I am using a Python script to extract the data and execute 'INSERT' statements to update my database.
Being that the file is so large, will I run into ...
6
votes
3
answers
22k
views
Client Sends XML, Server Parses XML, Queues Up and Executes Commands
I recently had a Java interview where I was asked to write a client-server application. I don't code primarily in Java, but with my preliminary Java knowledge, I thought I built a reasonable working ...
6
votes
2
answers
387
views
Checking the difference between old and new XML
I have two xml files, about 500mb each, an old and a new. I want to find out what items have been added or removed in the new.xml compared with the old.xml.
I had some help on this code and I'm a bit ...
6
votes
1
answer
5k
views
Alternative to a Grid in a StackPanel form for an easier way of inserting new rows
In my real life example I am at a layout stage and before I actually move any further I would like to review my current approach. I am still learning about UI, XAML on WPF technology and I guess I ...
6
votes
2
answers
2k
views
Parsing XML commands and parameters
I'm C# programmer and started Python recently for a new project.
This is a part of my project, and I want your opinion about my code and if it's clean or dirty, too long, has duplicate code, or it's ...
6
votes
2
answers
226
views
Console colorizer
To be able to apply various colors to the console I created a ConosoleColorizer. It's really simple. It just takes an XML and renders it to the console with the ...
6
votes
1
answer
313
views
File validator configured using XML
I am making an application to check for any files that does not follow a specific pattern defined in a XML file. The application works well, but the source code is not the greatest, and memory ...
6
votes
1
answer
11k
views
Single Sign On - SAML Response generation
I am trying to implement a IDP initiated Single Sign On Solution (service similar to onelogin's) to Cloud based Service providers such as Google Apps, Salesforce etc.
The project is a Maven eclipse ...
6
votes
1
answer
1k
views
API wrapper for translating XML requests and responses into objects
I'm looking for remarks on pretty much anything. This has been my first project that's meant for use by others and I'd like to have it as clean as possible. I will post the main source code here but ...
6
votes
2
answers
2k
views
Loading records from an XML file into SQLite
I have a script and I need to optimize it to reduce the execution time of this, currently, 6000 lines takes 1 minute and 38 seconds, I would like to reduce the time to take much less and I do not know ...
6
votes
2
answers
315
views
Loading card data from XML file
For our Cardshifter Project we wanted to be able to load card definitions from file.
A card is defined as:
Having an unique id.
Having a set of resources, which are integers identified by a string.
...
6
votes
1
answer
465
views
Extraction of data from Flickr
I'm crawling Flickr for data for my university research project. However it's very slow and I'm not sure what it is exactly. It could be the FileWriter slowing it ...
6
votes
1
answer
1k
views
Using XSLT to turn content of WYSIWYG stored in XML into HTML
The CMS I use uses the Xalan XSLT processor which is a XSLT version 1.0 processor. Editors who use WYSIWYG fields within the CMS can save content that will look like either:
...
6
votes
1
answer
642
views
Slow parsing of mutiple XML files to CSV
The code below is written as part of a parser, which files would be also added here: XMLParser, parser, Name, GenericElement, attrib
It reads an XML files from a folder, turn them into a dataframe ...
6
votes
2
answers
1k
views
Slicing Stack Exchange data dump XML files into small bites
I was posed with a challenge when trying to load XML files from Stack Exchange into a SQL Server database; some of these XML files are extremely large (largest one being a whopping 67 GB in a single ...
6
votes
2
answers
612
views
Authenticating web request to get the xml data from it
I wrote a method early of our development last year about getting the content of a webrequest where it contains an xml data that we need to process and insert to ...
6
votes
1
answer
3k
views
Android Compass
I have made my first app in Android Studio. I made a compass using a sensor-listener.
I would greatly appreciate if someone could review my code (it is very short), and suggest improvements.
My XML:
...
6
votes
1
answer
125
views
Themed Folder Classification
I am trying a very simple method of getting the theme information via a theme.xml within each theme folder.
What it should do:
Scan the theme directory ../themes
Return the names of all the theme ...
6
votes
1
answer
3k
views
XML Schema for an XML representation of CSV
This is intended to be part of a generalised solution to the problem of converting any (with some minor restrictions) CSV content into XML. The restrictions on the CSV, and the purpose of the schema ...
6
votes
2
answers
460
views
Parse dblp XML and output sums of publications grouped by year and type
The following Go program parses a gzipped XML file (available here) which contains bibliographic information on computer science publications and has the following indicative structure:
...
6
votes
1
answer
91
views
Build embedded XML based on string containment
I have a list of strings that represent a path. These are unique, unsorted values that look like this:
...
5
votes
3
answers
4k
views
Stock control system
I have programmed this simple Stock Control System using JavaFX for GUI and PostgreSQL for a database.
Please go through my code and point out flaws, inefficiencies, and better ways of doing things. ...
5
votes
3
answers
863
views
Complex search program
I am working on a fairly complex (at least it feels complex to me at the moment) search program and am looking to possibly increase the performance. Everything works exactly how I want it to, but I'm ...
5
votes
3
answers
19k
views
Return XML file from Web API
I have a HttpGet method which returns XML file:
...
5
votes
4
answers
3k
views
Is this architecture overly complex or following best practices?
I work as a C# developer at a company that doesn't use best practices at all. We're on .NET 3.5 but most code is written in a .NET 1.1 style (e.g. almost all the logic is in the code behind of the ...
5
votes
4
answers
4k
views
Make my XML Parser in Java using WoodStox run faster and use less memory, or just generally better
I have an XML Parser in Java using WoodStox that I wrote. This parser is going to be parsing through extremely large files, could be 5+GB. The goal of the parser is to convert a nest XML file into a ...
5
votes
3
answers
452
views
Xml serialize to object
I have to read some data from xml file and then need to store the converted json in the database. The class DtoProcedureXml mapped with xml attributes.
...
5
votes
3
answers
3k
views
Converting KML/XML to Javascript
So, I have the boundaries of every states in the US, from the google map KML file.
This KML file is actually a XML file.
I'm converting this file to a JS file compatible with google map in order to ...
5
votes
3
answers
21k
views
Python script to delete sections of text
I've been writing a python script to help me clear up some files that contain outdated code, while also serving as a way to learn python. These files have sections of code surrounded with tags on ...
5
votes
2
answers
234
views
How to avoid duplication in my document writer?
I have these two methods which are generating two different xml files whose header section is same and detail section varies. The root node is different for both xml files. Here I have two methods ...
5
votes
4
answers
8k
views
Presenting a boolean as an int for XMLSerialization in C#
I'm working with an XML structure that requires booleans to be represented as 1 or 0.
So, suppose the XML output has to look like:
<valid>1</valid>
...
5
votes
3
answers
415
views
Fetching, adding, and viewing games
This is a simple application that will eventually manage certain files for video games. For now, I'm only posting code that handles fetching, adding, and viewing games.
I'm trying to keep things ...
5
votes
2
answers
1k
views
Short XML parser
This is my first code in C# ever. It compiles and works as intended (not complete), but I want to see what I'm doing right and wrong as a first-timer.
...
5
votes
1
answer
48k
views
Android layout with equal spacing between elements [closed]
I am trying to make a nice set of items, which are equally spaced from each other.
On example below, I set buttons between empty textview. Every button and text view has ...
5
votes
2
answers
1k
views
XML/HTML Read/Write
I am developing a .Net application that involves reading data from XML and writing to HTML. The methods to do these tasks are all in the same class as the data they read/write are properties of ...
5
votes
3
answers
9k
views
5
votes
3
answers
4k
views
Proper and elegant way of Building a XML Document
I need to build the following XML document
...
5
votes
2
answers
6k
views
Parsing an XML file with elements for keys and values
I'm parsing an XML file that is structured like this:
...
5
votes
1
answer
3k
views
Walmart scraping (crawling) code
I am currently trying to make a Walmart Scraper, where I have to scrape the title, link, image URL, price, category and subcategory of the product.
Now my approach is that I will collect seed pages ...
5
votes
1
answer
311
views
My script is about as scary as the XML it's reading
This was a revision, made when the code failed after an update (at least that is what I think happened).
So I fixed it and now it works, but I think that this code can be written better and more ...
5
votes
1
answer
2k
views
Survey program using JSF and Ajax
I'm new to AJAX and am trying to learn by myself with a small test:
It's a survey with 3 questions. I would like to know if I'm using AJAX the correct way, before starting bigger projects.
Here is ...
5
votes
2
answers
1k
views
5
votes
1
answer
2k
views
XML parsing in Java using SAX parser
I have started learning XML parsing in Java (currently reading Java & XML by Brett McLaughlin). Here is my first program to parse XML using SAX parser. Please review the code and let me know if ...
5
votes
3
answers
567
views
Reading and working with a large number of XML attributes
I'm currently facing the problem of unmarshalling a huge number (47) of attributes to a Java object. Changing the format of the XML file to be more structured is sadly not an option.
The following ...