Questions tagged [xml]

Extensible Markup Language (XML) is a structured document format that defines human- and machine-readable encoding rules.

Filter by
Sorted by
Tagged with
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 ...
alex's user avatar
  • 173
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 ...
Mathieu Guindon's user avatar
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 ...
sigint's user avatar
  • 73
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 ...
NPN328's user avatar
  • 761
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 ...
Jeffro's user avatar
  • 131
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: ...
Laura's user avatar
  • 295
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 ...
Aaron Brandhagen's user avatar
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 ...
DigitalEye's user avatar
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 ...
Jimmy's user avatar
  • 473
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 ...
user avatar
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 ...
Reza Akraminejad's user avatar
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 ...
t3chb0t's user avatar
  • 44.3k
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 ...
Linus's user avatar
  • 917
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 ...
Raghav RV's user avatar
  • 225
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 ...
Jeroen Vannevel's user avatar
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 ...
Nicole's user avatar
  • 63
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. ...
skiwi's user avatar
  • 10.7k
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 ...
bigubosu's user avatar
  • 163
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: ...
Jason Aller's user avatar
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 ...
ebe's user avatar
  • 241
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 ...
Phrancis's user avatar
  • 20.4k
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 ...
rpmansion's user avatar
  • 307
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: ...
Inagidba's user avatar
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 ...
CodeX's user avatar
  • 1,053
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 ...
Sean B. Durkin's user avatar
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: ...
orestisf's user avatar
  • 163
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: ...
Bram Vanroy's user avatar
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. ...
codez's user avatar
  • 969
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 ...
Volearix's user avatar
  • 829
5 votes
3 answers
19k views

Return XML file from Web API

I have a HttpGet method which returns XML file: ...
StepUp's user avatar
  • 553
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 ...
Wayne Molina's user avatar
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 ...
John Lexus's user avatar
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. ...
rebornx's user avatar
  • 153
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 ...
bl0b's user avatar
  • 395
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 ...
Psycrow's user avatar
  • 191
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 ...
user3651810's user avatar
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> ...
MPelletier's user avatar
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 ...
Tyler Daniels's user avatar
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. ...
Curtis J.'s user avatar
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 ...
Yarh's user avatar
  • 255
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 ...
Michael Brandon Morris's user avatar
5 votes
3 answers
9k views

Building XML by enumerating through array & hashes

...
maxhungry's user avatar
  • 151
5 votes
3 answers
4k views

Proper and elegant way of Building a XML Document

I need to build the following XML document ...
SerenityNow's user avatar
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: ...
mxdsp's user avatar
  • 153
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 ...
user221739's user avatar
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 ...
Malachi's user avatar
  • 28.6k
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 ...
user avatar
5 votes
2 answers
1k views

Generic methods for serializing and deserialzing xml files using streams

...
Vincent's user avatar
  • 203
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 ...
JavaHopper's user avatar
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 ...
Marv's user avatar
  • 390

1
2
3 4 5
9