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
3
votes
1answer
586 views

XML design for parsing in C# [closed]

I am trying to design XML with configuration info so I can parse it into this code: ...
1
vote
2answers
100 views

Rewrite XML generator in Java

I was given a program that generates XML, filters and sorts the elements. The program was rather terrible on purpose because it is an assignment. The original output looked like the following: ...
1
vote
1answer
5k views

Parsing SOAP messages from a web service

I'm consuming an ASMX service with SOAP messages. Since Xamarin doesn't support SOAP 1.2, I'm writing the Web requests manually. I'm sending a user/password to retrieve the user ID. A successful ...
1
vote
0answers
101 views

Finding an XML element value using Rust

The following is a struct to extract a value between named XML element tags. Though it works, I feel there is functional approach in Rust that I am missing. Any other tips on Rust preferred styling ...
2
votes
1answer
297 views

Parsing XML documents with LXML

I'm new to LXML, and parsing XML documents in general. I have written a small section of code that appears to do what I need it too do, but it feels like I have overly complicated it. Is there any way ...
3
votes
0answers
66 views

Parsing XML to get report job id and save final XML to file from an API

The objective of this code is to contact a server with a reporting API and run the specified report from the user generated configuration file, once the report has been requested to server responds ...
2
votes
1answer
47 views

Documenting and commenting code using xml tags

I am going to rewrite my AddIn I made for the Autodesk Inventor software. It is supposed to do specific task that are not available by default in the program. I am not a programmer but a draftsman ...
3
votes
1answer
2k views

Finding data on XML using Python's LXML

Using Python's LXML I must read an XML file and print from each "basic" and "expert" tag, the name and email text from it. I've done a script that works but I don't think is the best way of doing this....
2
votes
1answer
2k views

Removing whitespace in self-closing node and keeping UTF-8 hex entity values intact?

I work with some xml files which have UTF-8 characters like ©, ë but they are converted to their image counterparts i.e. ©, ë, whenever I use ...
0
votes
1answer
2k views

Modify XML attribute based on element value

I have some xml files that have some nodes like (among other nodes) ...
0
votes
1answer
461 views

In progress XML parser (xml writer class)

I was wondering if someone wouldn't mind reviewing this XML writer code that I've been working on. It should be fully functional, and includes an example of how to use it. ConsoleApplication1.cpp <...
3
votes
1answer
376 views

Web scraping data from US postal zip codes

Web scraping county, population and median home value from United States postal zip codes. I switched from using InternetExplorer.Application to New MSXML2....
8
votes
3answers
239 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 ...
1
vote
1answer
137 views

Mini game for android

For Android in this mini game the monkey catches nice bananas and coconuts. It was somewhat more problematic to create the layout in XML compared to the small game engine and controls. Maybe we ...
3
votes
2answers
215 views

Parse atom RSS feed with xml.dom.minidom

I had to parse a blogger RSS feed but I didn't have access to any third party modules like feedparser or lxml. I was stuck with the task of writing a library to parse RSS feeds; challenge accepted. I ...
1
vote
1answer
815 views

Generate c# classes through XSD.exe automatically based on embedded resources in assembly

This program is supposed to take every embedded XML Schema file in an assembly and generate classes in the csOutPath. The names of the classes and files should match the stored schema and be put in ...
2
votes
1answer
394 views

Reading file from flash with Xamarin.Forms on Android using ActionOpenDocument intent with StartActivityForResult

I have a Xamarin.Forms application which utilizes dependency services to access Android specific features, in this case file access on the storage. The file we are accessing is a serialized .xml file ...
5
votes
0answers
3k views

Merging multiple app.config files

I have a few complex app.configs that I constantly manage to break. This often costs me a lot of time until I find the error/typo. To prevent such situations in future, I wrote a simple utility that ...
1
vote
2answers
663 views

Refactor nested null checking for multiple possible string values

I am parsing an XML file and trying to get the guid of a node where it has an attribute "name" and a value of "Name" like so: <...
3
votes
2answers
333 views

Using QXmlStreamReader to read configuration file of key-value pairs

Background The following XML snippet contains configuration parameters for our application in key-value pair manner. (Despite using INI files for such purpose may be better, I have to use XML files.) ...
0
votes
1answer
88 views

Adventure game for Android

Features Abstract class World.java which works for basically any game Game engine class Simulation.java which steps forward time and introduces random events Walking persons, places and connections ...
5
votes
1answer
82 views

Optimize and accelerate bash script to transform XML to SQLITE

I have this script in which I read an XML and I pass it to CSV and at the end of the script I transform it into SQLITE ...
6
votes
2answers
846 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 ...
0
votes
2answers
1k views

Importing complex XML file into a flat object

I am trying to parse xml file using XDocument, basically, I have to select xml element based on requirement and convert into list model. Below is sample code I am ...
1
vote
1answer
93 views

Replace ApplicationName in SSIS config file with filename

We have a bunch of SSIS packages that use .dtsxConfig files for various variable transformations, but mainly for the connection strings. While doing some SQL tracing, we noticed that almost all our ...
9
votes
2answers
553 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 ...
0
votes
1answer
625 views

Golang visitor pattern for marshaling shapes as JSON, and XML

I was trying to implement visitor pattern in Golang, and came across an idea of using a generic func type instead if interface ...
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 ...
1
vote
0answers
136 views

Converting Cisco IOS output to XML

The INPUT FILE is created by a script that runs "show interface description | i FN" against each of my routers. Once I have that file, my PYTHON SCRIPT below, parses the INPUT FILE for each of the ...
2
votes
1answer
206 views

ETL project, handling XML, CSV, and text files

I have completed an ETL project to collect, parse and load files. I decided to make it clean OOP way using interfaces and abstract, but have some questions below. ...
1
vote
0answers
51 views

Extensible XML parser

Context My aim is to write an RSS parser that can handle extensions in a generic and type-safe way. I already have a working RSS parser, the missing part is the extensions handling, which is the ...
1
vote
1answer
33 views

Dual rewrite rules (WWW prefix and HTTPS)

I want to configure my website to force a www. prefix on the name, and the HTTPS protocol. ...
2
votes
1answer
68 views

Three very similar functions operating on XML files

I have 3 functions which are annoyingly similar, but I can't figure out a way to refactor them without making the code unreadable. The three functions deal with xml files (...
4
votes
2answers
4k views

Download, unzip and parse xml into pandas dataframe

I have a python script that downloads, unzip and parses an XML file published by a Canadian institution. Only some very specific tags are extracted and then all put into a pandas dataframe for later ...
3
votes
1answer
124 views

Turn XML into Object

I've got a working program that turns XML into a XmlObject. The object can then be accessed using getName(), getValue(), and getChild(). The code works but I'm looking for recommendations. I couldn't ...
5
votes
3answers
12k views

Return XML file from Web API

I have a HttpGet method which returns XML file: ...
0
votes
1answer
3k views

A complex selection LINQ query

I am stuck on recursive selection of the objects for TreeView. I have some class IMenuDataSet, that stores objects, named 'I' in the List property: ...
0
votes
1answer
99 views

Converting Confluence markup to a simpler XML format

I have a code that converts one xml structure to another. I am removing unnecessary tags and replacing some temporarily. I think I have way too many replace operations and wondering if there is a way ...
1
vote
0answers
495 views

Easily Create XML within PowerShell

The purpose of this PowerShell function is to make it simpler to output XML in a given format. For my use case, that XML did not have a schema associated, so I've not implemented any namespace logic; ...
3
votes
0answers
2k views

Creating Android layout with GridLayout

I'm trying to create a Layout with two columns which are next to each other (I'm accomplishing this behavior with a LinearLayout). Inside each column, I have two TextViews and two Buttons, which I ...
4
votes
1answer
106 views

Parsing Geographic Data From XML Files in Python

I have recently been working on a program which takes as input, log files generated from a running/biking app. These files are in an xml format which is incredibly regular. In my program, I first ...
3
votes
0answers
300 views

Recursive function to compare XML files using MSXML DOM

I have put together this function which compares two XMLs. On debugging, I found out that there are lot of useless loops which might cause performance problems for me if the files to compare are very ...
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 ...
3
votes
1answer
170 views

SqlServer database reflection and autogenerating NLog.xml

This is my first attempt at using T4 templates and I thought I generate the NLog.xml with it by getting the tables and the columns from the database to ...
2
votes
0answers
43 views

Parse an XML and retrieve zero or one attribute per level starting from a leaf

I need to extract from a large XML file some information: 0 or 1 attribute per tag Trigger on a leaf element So I wrote this Python code: ...
1
vote
0answers
300 views

Utility classes for XML

I have a class which makes calls to a static class. this class started off as a test utility class, primarily for performing operations on xml via XPath. Eventually some of the methods in the XmlUtil ...
3
votes
1answer
100 views

Loading configuration properties from XML

I would like a review of the transformation of the first method to the updated one below: ...
0
votes
3answers
62 views

Opening and validating an XML file

I have a section of code that repeats many lines and I am looking to refactor this code possibly so that a function can be used instead of the same lines of code each time. Below is the section of ...
6
votes
2answers
805 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 ...
2
votes
2answers
2k views

Parsing XML to get all elem.tag: elem.text pairs

I am parsing ICD-10 codes and have achieved a result that satisfies my base case, but I'm worried about how fragile my method is: ...