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
25
votes
2answers
57k views

JAXB XJC code generation - adding @XmlRootElement and Joda DateTime

Here's an interesting scenario that I encountered the other day. I did eventually reach a solution on my own. However, I'd welcome any comments and better approaches. The requirements I want to ...
19
votes
3answers
259 views

Translating the Rubberduck - Übersetzen der Gummiente - Part 1: Modelling

So I have committed to making a German translation for the guys over at Rubberduck, which is localized via .resx files. Now these files are basically XML-Files with a certain, rather simple document ...
14
votes
2answers
3k views

O PC, why are you so slow?

In order to test some software I've written, I need to write values to a test harness with OLE for Process Control (OPC). The problem is, for a larger range of values I'm generating points for (say ...
14
votes
2answers
242 views

Learning by translating - Follow the Rubberduck - Part 2: Beta

This project is my learning place for a few things: MVP (model view presenter) XML (parsing, editing and leveraging) deeper swing functionality Concerning the XML part I have already recieved a ...
13
votes
1answer
156 views

#TODO Remove duplication in XML parsing

I have to modify the number of points in this XML in order to test the performance of another program of mine. Here is an example of the XML I have to modify. performance.xml: ...
13
votes
1answer
266 views

A vanilla JavaScript library for typesetting pseudocode in HTML documents

I have this plain JavaScript library for typesetting pseudocode in HTML documents. (See the documentation for details.) (See the GitHub repository - broken as of now.) Source code algotype.js <...
12
votes
2answers
1k views

XML format for game data

I want to create an XML format in which I will define data objects for a game I am currently working on. The base idea is that I will have Elements which can be ...
12
votes
1answer
2k views

Why does the new ADT create a static inner class Fragment by default?

Honestly, I can't help but feel that this is done merely to confuse newcomers. Most of the errors on Stack Overflow by complete Android newbies mostly stem from that they have a static inner class ...
11
votes
2answers
1k views

Find records with duplicate serial number

I was tasked today with cleaning up data from a SSRS report put together by a DB programmer. The original report was to find duplicate serial number sales within a user-defined period of time. I was ...
11
votes
2answers
1k views

HTML/XHTML/XML tokenization

I want to write a library to parse any valid or invalid HTML-like things. First of all, I am trying to build a lexer. Here is what I did; ...
10
votes
2answers
3k views

xml is XML is xml is XML

I had to write some code for an interview, to print out the name attribute of each node. I started off going in the wrong direction, so I didn't get to finish. I wanted to finish writing the code, so ...
10
votes
3answers
7k views

VB.NET code to AES encrypt and decrypt

I wrote this for use internally at work and have never worked with encrypted data before, so can you please critique? It's written in VB.NET which I have decent experience in, just not the encryption ...
10
votes
3answers
12k views

Read/write to XML using LINQ

This will compile, but I'm thinking that this implementation of read/write is very hard coded and would not be easily adapted to larger situations where large XML documents are being processed or if ...
10
votes
4answers
388 views

XmlCmdBuilder - doing away with inline xml

I have to work with a 3rd-party API that allows me to define and execute "commands", using XML. Since I don't like seeing mixed abstraction levels, I managed to remove all the inline XML / string ...
10
votes
1answer
238 views

Civilization 5 mod validator

I would like to submit a portion of my code for Code Review, and I have done my best to comment the code (and include essential parts that may aid understanding of the program) for your convenience! ...
10
votes
1answer
7k views

Import multiple XML files into Excel

I have adapted a VBA code to import all the XML files I have on a folder into Excel. I have tried to run the code with only two files and it takes about 30 seconds. Several minutes to import less than ...
10
votes
1answer
1k views

Saving an XML file created by Tesseract OCR as a traversable object

My project here works upon output that comes out of a Tesseract OCR scan using hOCR format, then I read it with JDOM 2.0 and finally save it one of my own objects, which at a later point needs to be ...
9
votes
5answers
13k views

Basic XML Writer in C++

This is an XML Writer in C++. It doesn't do much but the basics, and I've tested it, so it should hold up well enough. I hope in the near future, I can bring you an XML Reader. I kinda built the ...
9
votes
4answers
8k views

Determine if a file is either in JSON or XML format

The purpose of this function is to determine if report_input_file is either in JSON format or XML format, this is what I came up with, just want to know if this is ...
9
votes
2answers
530 views

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

I have to interface with a horrible PHP SOAP API that returns nested arrays of strings. I've written a helper that can parse the SOAP response and return a dynamic object but I need at least some ...
8
votes
3answers
16k views

Replacing non-ASCII characters

I wrote a C# program to remove non-ASCII characters in a text file, and then output the result to a .NonAsciiChars file. The input file is in XML format. In fact, ...
8
votes
4answers
19k views

Check if XmlNode with certain attribute exists and create XmlNode if not

I'm not going to explain the purpose of the code provided below. If you do not understand it, i know that i have to improve it (naming, structure etc.). I would like to know how to improve this code ...
8
votes
2answers
94 views

Comparing Server Version Number History

I have this code that compares all version numbers of servers. (The version numbers are stored in an XML file) Before the code would compare the current version number with the previous. This caused ...
8
votes
4answers
8k views

Convert XML to CSV

I'm pretty sure this code can be optimized, but I'm not talented enough in Linq to do it myself. Here's what I'm trying to do: I have an XML file that needs to be converted into a .csv file. The XML ...
8
votes
1answer
983 views

XML tags constants vs hardcoded values

I have to create an XML body for a web service call. I want to use: ...
8
votes
3answers
236 views

Getting information about music that is popular in a country

I have this code below that has 6 distinct parts: Necessary imports Get the top artists from a specific country using last fm api Get some info about this returned artists Get top albums from that ...
8
votes
1answer
10k views

Object-to-XML string implementation

I have recently implemented a code to accomplish Object-to-String. Can you suggest any pros and cons with regard to the code? <...
8
votes
4answers
13k views

Mapping the differences between JavaScript objects

The reason I want to do this is that the JavaScript objects are created from XML elements and if the element has changed I want to be able to detect that change in the JavaScript objects. So I wrote a ...
8
votes
1answer
145 views

Reading Values From Enviromental Monitor XML Feed

I have written the below code to handle accessing and parsing the data presented in XML format from our server room environmental monitor. The plan is to call this class from a controller/view ...
8
votes
2answers
950 views

Strategy Pattern Implementation

I thought I would learn a design pattern today and picked this one. I wrote a simple Android test demo to test the pattern. main.xml ...
8
votes
1answer
265 views

Basic XML template

I am currently exploring the play framework. I'm about to replace the proposed templating system, using the powerful XML processing of the Scala library. Here is what I have come with: ...
8
votes
1answer
848 views

Extending the functionality of lxml.etree

I wrote a class to slightly customize the behavior of lxml.etree.ElementTree and I use it quite extensively. It works great, but there are a few methods that I'm ...
8
votes
1answer
10k views

Converting partial XML (Node List) to a String

I have a need to extract a part of XML tree (everything under root) and convert it to a string. (The result string will be later pasted inside ...
8
votes
1answer
194 views

Load and parse Stack Exchange data dump XML into DB table

I have put together a stored procedure to load and parse the Stack Exchange Data Dump into a relational database (akin to Stack Exchange Data Explorer). Each site has 8 XML files like these: The ...
7
votes
4answers
4k views

Extracting key information from a directory of XML files

I have written some VBA to loop through a directory of 15,000 XML files and extract key information from these files into Excel - this is unbearably slow. Can someone please assist me in optimising ...
7
votes
4answers
507 views

iTunes playlist copier

When you own an Android device and want your iTunes playlist to be copied over onto it, what do you do? What if your playlist hits something in the region of 20GB+ ? Well, I am sure I could've paid ...
7
votes
3answers
2k views

Handling various types of nodes when traversing a DOM tree

How to minimize the following code using java's features ... looking for some workaround with the switch-case statement I've seen several question regarding switch-case design pattern / best ...
7
votes
2answers
3k views

SQL query to compare two XML columns

I need to compare two XML columns. I currently have about 1000 rows of data that this is running against and it takes about 20min. Is there anyway I can improve this query to run faster. ...
7
votes
2answers
1k views

XML settings implementation

I'm trying to figure out how to do this more dynamically. Right now I save each and every form field individually/manually. I would love to maybe have some kind of master form list that I could loop ...
7
votes
1answer
879 views

Android “Search” Activity and corresponding XML

Below is an Android Activity and corresponding XML layout. The function of the class is to search an ...
7
votes
2answers
5k views

Parse and write data from/to a xml file

I recently started to learn Python for the purpose of making my life as a network engineer easier when performing repetitive tasks. The script below does parse a huge inventory.xml file I get from a ...
7
votes
3answers
277 views

Too many null checks in an XML-to-XML transformation

I'm writing a conversion mechanism in C#. I deserialize a big XML document of one type and return a big XML document of another type (via serialization of another object). While I'm doing the ...
7
votes
1answer
1k views

Parse XML using Python XML eTree

I am a high school intern, and I am trying to parse my mentor's code so that he can read in an XML file and call simple methods to edit or get information from his XML file. I was hoping someone ...
7
votes
1answer
542 views

Python XML parsing, extraction and renaming files

I've written some code to: Parse an XML file. Extract some strings. Make copies of the original XML whose names are suffixed with the extracted strings. Please review this. ...
7
votes
3answers
610 views

Rigidness and verbose nature of XML parsing

I've been developing a simple console application in C++ using the TinyXML2 library, and I honestly can't help but feel what I'm doing is not very robust. Maybe that's just the nature of parsing XML (...
7
votes
2answers
448 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
3answers
3k 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
1answer
702 views

Build menu from MS Word XML

I've recently assembled some jQuery that allows a user to build out a bulleted list in MS Word with hyperlinks and turn that into a HTML unordered list. Ideas for uses are website menu systems where ...
7
votes
2answers
593 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
1answer
355 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: ...