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
2
votes
1answer
2k views

Create Directed Acyclic Graph (DAG) from XML-Tree

I've written a program that creates the (minimal unique) directed acyclic graph from the tree structure of an XML-document. The program prints a Bplex-Grammar to cout. I'm interested in all kinds of ...
0
votes
1answer
5k views

Manipulate XML files in c#

I just finished my working code, but still want to improve it. I want to transform this input: ...
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 ...
2
votes
3answers
6k views

Parse an XML file using objects / methods

So I spent a while this morning creating an xml parser in java which is part of a job interview. I would love to have some people tear it apart so I can learn from any mistakes that I made so I can ...
1
vote
2answers
168 views

Using Choose and Apply Templates with Mode, vs Complexless Template Matches

So I have a little XML (Sub)language, it has 3 elements of interest: para, point, and code ...
3
votes
2answers
10k views

XML schema parser

I've been working on a lightweight XML schema parser, and have what I think is a moderately clean solution (some parts helped out by previous questions I posted here) so far for obtaining all schema ...
2
votes
1answer
2k views

Converting NameValue pair entity to XML

I have the following code, to store a web service name value pair response into DB. I am saving it in xml column of DB. Kindly highlight the issues with this approach. Please note that the name value ...
6
votes
1answer
7k 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
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 ...
6
votes
1answer
2k 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 ...
2
votes
1answer
2k views

Loading XML and csv files to datatables at startup

Here is some code that I put together for an app I am working on that loads 2 XML files and a large CVS file to a dataset at startup. It runs fairly fast, but I would like a second opinion on what I ...
4
votes
2answers
3k views

Making a flat file

Source XML (since I haven't bothered with a schema): ...
2
votes
2answers
4k views

Loading config file from XML

After my question on StackOverflow, I've written code that should create a Config class from an XML file. XML loading is mixed with structures declaration and break ...
1
vote
1answer
2k views

Receiving an XML post and parsing

I need to receive an XML post then process all the data, and do whatever I need to do with the data. I could be receiving anywhere from 60 to 100 values. I know what all the elements are going to be, ...
5
votes
1answer
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 ...
2
votes
1answer
1k views

Escaping XML to be used with SOAP [closed]

I'm attempting to escape ampersands from a string before passing to PHP's SimpleXMLElement->addChild() for use with some SOAP webservices, but I don't want to ...
1
vote
1answer
156 views

How can I make this XML gallery snippet prettier?

Everything works, i just want to know if i can change the way the xml tags are retreived. This way seems a bit bulky - but i could be wrong. Thoughts? ...
2
votes
2answers
378 views

Parse in currency rates of major cities

I'm creating a website that parses in currency rates of the three major cities listed below in the $cities array. ...
2
votes
1answer
340 views

Collection of XmlNode control

I have implemented the structure below at least 5 times, and it is getting cumbersome. Is there a better approach? Current code-segment implemented ...
3
votes
2answers
703 views

Configuring a currency converter to get exchange rate feeds for for multiple currencies

I'm trying to make my function more versatile by removing hard coded data. ...
4
votes
2answers
3k views

XML parsing and data conversion with Swing

This is my first forray into Java Swing and it's not exactly pretty. I have quite a few methods, and a lot of stuff going on (XML parsing, data conversion, etc) and I'm just wondering what kind of ...
0
votes
1answer
603 views

Python xml schema parsing for simpleContent and simpleTypes

I am writing a few python functions to parse through an xml schema for reuse later to check and create xml docs in this same pattern. Below are two functions I wrote to parse out data from ...
5
votes
2answers
12k views

Parsing XML in Python

The aim of this code is to return an object which contains all of the movies. Where attributes are not found, they need to return None rather than be undefined and ...
3
votes
1answer
459 views

filter out password in xml string

We're storing the xml communications with an external service in a text in the db and in a before_create I've got the following: ...
3
votes
4answers
790 views

Improving search through XML file

I'm working on a function that extracts information from an XML document and compares to what the user has typed in. Can you suggest any ways in which I can improve it? The variables in the XML file ...
4
votes
2answers
719 views

Reusable configuration reader for Java

This is related to a question I posted on Stack Overflow. The consensus was to use JAXB, which is what I did. One of the requirements was that it needed to work with legacy XML configuration files. ...
3
votes
1answer
4k views

Reading a large XML file and parsing necessary elements into MySQLdb

I have fair concept in a programming (learner) but not an expert to refactor code at the highest level. I am trying to read a huge (100MB-2GB) XML file and parse necessary element (attributes) from a ...
2
votes
2answers
11k views

Importing XML to a database using LINQ to Entities

I am importing XML data to a MySql database using LINQ to Entities. The data represents which students are in which classes, and looks like... ...
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: ...
5
votes
4answers
6k 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> ...
2
votes
1answer
3k views

Simple XML Creator in Java

...
3
votes
2answers
9k views

Reading XML in C#

This seems like rather too much nesting: ...
4
votes
5answers
244 views

Script for performing tasks with acquired XML files

I have been working on a script for almost a month now, which takes in an XML file and uses it to either download or upload files from an ftp site. It also copies the files to a history directory for ...
5
votes
1answer
561 views

Processing XML configuration which stores regular expressions and format strings for a documentation tool

I'm investigating some feature for the ScalaDoc tool, which would allow library writers to link to documentation created by third party tools like JavaDoc. My idea is to have some (XML) configuration ...
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 ...
2
votes
1answer
5k views

Parsing and data presentation in Django

For some time now, I've been using a pattern which I think could be done more elegantly. I have a lot of XML files that need to be represented in a Django views. My current approach is like this: I ...
2
votes
3answers
1k views

Is there any faster way instead of using preg_match in the following code?

this code finds if there is the string 2004 in <date_iso></date_iso> and if it is so, I echo some data from that specific element that the search string ...
3
votes
1answer
361 views

In need to speed up this code that filters the data of XML using XMLReader

I am using XMLReader and avoided SimpleXML because I must handle a huge file and for memory issues, SimpleXML is not the ideal solution. However, even I coded the below script in SimpleXML, it gives ...
3
votes
1answer
15k views

XML schema parsing and XML creation from flat files

I am new to Python and had to create a schema parser to pull information on attributes and complex types, etc. and then convert data from flat files into the proper XML format. We are processing a lot ...
1
vote
1answer
217 views

Parsing XML file containing some events

I'm a beginner and have written my first Python module that parses a XML file containing some events and prints them out to stdout as JSON. I would appreciate some ...
2
votes
3answers
159 views

XML-tag function

I'm an experienced programmer, but just a beginner in Python, and would like some input on a small function that's working but which I'm not very happy with. It's used to produce XML tags (strings). ...
4
votes
3answers
9k views

There has to be a better way of parsing XML in C# than what I'm doing

This is the way I'm currently getting data from XML, but it seems to be really inefficient, checking every localname in every iteration. How should I be doing it? Here is a sample of the XML I am ...
6
votes
1answer
11k views

Parsing huge xml file with lxml.etree.iterparse in python

After solving the error in SO (like suggested) I return now for codereview. :-) The task is to parse a huge file dblp.xml (~800 MB) presented by DBLP. The records ...
5
votes
4answers
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 ...
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 ...
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 ...
4
votes
2answers
2k views

Generating XML file from text input

I am hoping the code is readable as is. I can probably just print the XML using streams but I have other reasons for using the library. Please offer any inputs on how to improve program design/...
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 ...
3
votes
1answer
328 views

Inserting and updating time spans in XML

I need help to refactor my code. I usually had a hard time figuring out how to make my code reusable. I have an XML file that hold the data for each Tag element. Tag element should have child nodes ...
6
votes
1answer
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: ...