Skip to main content

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
2 answers
302 views

Receive byte string (high speed position output) from FANUC robot, parse and append to dated .xml file

This script just opens a TCP server to listen for real-time position data from a FANUC robot to pass to another sensor software we are using (Luna Terahertz sensor). So far everything is working great,...
1 vote
1 answer
516 views

Python script to read an XML file and write some information to an Excel file

I'm getting an XML file from an application, want to extract some information from that file and write it to an Excel file. The XML file contains data about vacations. I need data from the last month ...
1 vote
1 answer
146 views

Managing PySpark DataFrames

I was successfully able to write a small script using PySpark to retrieve and organize data from a large .xml file. Being new to using PySpark, I am wondering if there is any better way to write the ...
0 votes
1 answer
82 views

types.xml XML file merger

A friend of mine and me are running a modded DayZ server. One of the common tasks when adding mods that include new items is to update the server's types.xml file (example). My mate did this by hand ...
1 vote
2 answers
138 views

C# addXmlDefinition method

I have this methods that take in a xml file and add XDeclaration for utf-8. I want to optimize the code because it need to ...
0 votes
1 answer
99 views

Retrieve data from an XML file in Java

few months back I did a code test for a company and I quickly managed to solve it within 5-10 minutes. But, I got rejected because it wasnt "good enough". What is good enough? they said its ...
1 vote
2 answers
68 views

Parse give CSV of UK phone numbers, filter non-conforming numbers and output XML of correct numbers

This script takes a CSV of numbers and processes them to check to see if the numbers conform to the UK standard 11 digit numbers. Any errors are outputted to a log and the correct numbers sent to an ...
4 votes
1 answer
122 views

Enables markup to instantiate objects, call methods, and generate HTML

I created this package PXP. PXP enables markup to instantiate objects, call methods, and generate HTML. It works similar to a server-side templating engine, but rather than enforcing braces it ...
2 votes
1 answer
139 views

Extracting authors and books from XML and inserting them into PostgreSQL

There is a tree of start folder, it's subfolders, their subfolders, etc. In each folder, subfolder, etc. there are the same structured XML files stored. books.xml ...
5 votes
1 answer
220 views

Traverse/transform (xml) tree

I am trying to write a utility for transforming xml trees using single pass and specifying node handlers. I used pugixml prior to this, and the library provides a ...
1 vote
1 answer
76 views

Parsing an XML tree of categories

I have parse function which is parsing tree of categories. I've written it in simplest way possible and now struggling with refactoring it. Every nested loop is doing the same stuff but appending ...
4 votes
1 answer
1k views

Translate SOAP response into a CSV using Python

I have this XML from a SOAP call: ...
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 ...
2 votes
0 answers
87 views

Bot gets data of sitemap, parses it and send message to Telegram channel

UPDATED - 25-12-2021 Summary: Renamed start.py --> bot.py Modified a lot of code in bot.py Modified code in sitemap.py Created init.py Check the update code in the bottom of this question. I ...
3 votes
1 answer
1k views

Parsing XML file from the REST API

Please suggest how I can improve my code (like memory leakage, which pattern to use etc.). I have to parse a book XML in two ways: first from an FTP file and second from the REST API. I implemented ...
1 vote
0 answers
998 views

Extract series of XML elements' values into an array

This code needs to extract data from in XML file. Specifically it needs to iterate over it, looking for a node called CHARGE_CODES that repeats over and over and ...
3 votes
1 answer
290 views

Python script to parse XML file into Json

How are you doing? I have to make a script to parse an xml input file to a json file. I tried to do my best, but it will be nice if you could check it and help me to improve it. The idea is that I don'...
2 votes
1 answer
123 views

Is this a good design for runtime Macro execution?

I am developing a system for runtime macro executions in an automatic test environment. Macros are defined in an xml and are for configuring multiple devices/DUTs for a specific use case. The xml ...
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 ...
1 vote
0 answers
104 views

Improving speed of parsing XML file

...
1 vote
0 answers
722 views

Parsing a large XML file and storing in Postgres efficiently using Pythonic code

I have a bunch of large XML files that I have to parse and store in Postgres. I have done a lot of procedural code but I want to think in terms of objects and reap the benefits. Any help in that ...
4 votes
1 answer
116 views

Scheduled Notifications (First Android App)

I'm happy to present my first Android project, which collects market index data (three Asian indices) and fires a notificaiton every Wednesday, Thursday and Friday at 7:30 AM displaying the data. I've ...
2 votes
0 answers
1k views

Read compressed XML file inside ZIP and parse data as fast as possible

I am trying to read and parse an XML file inside of a ZIP archive as fast as possible. The XML file is roughly 85GB in size, so I know for a fact that I/O also plays a role here, as I need to ...
4 votes
1 answer
754 views

Enumerating ancestors in XSLT

I've been playing with some genealogical files in XML lately and wanted to create a transform that would list, for each person, the person's name, the count of ancestors, and the list of ancestors. ...
2 votes
1 answer
375 views

Format potentially invalid XML

I'm working on an application that allows users edit/fix XML. A part of this is to format the XML for better readability. As the XML might be invalid, the existing methods I found for formatting (like ...
2 votes
1 answer
2k views

Java CSV to XML converter

I'm relatively new to programming and I was trying to work a project. I would like recommendations of how to annotate or comment my project and any improvement I could make to it, any suggestion is ...
3 votes
2 answers
549 views

Handle missing children nodes when parsing XML into a dictionary

I work on a code-base that uses xml to set up problems and specify model parameters. I've created a script that I run in tandem with our code. This script will ...
3 votes
0 answers
42 views

Organizing and accessing data in xml database - VB.Net

So I made an XML database for my music player where I store songs data (title,artist,album,genre,year) the code for generating the database is working but slow as heck, the code works as following ...
5 votes
1 answer
76 views

Refactoring a class that counts xml dom nodes and caches the result

I saw this entertaining talk by: Bob Martin on clean code and started refactoring a relatively simple class today. I am, by no means, an expert on coding and still learning a lot every day, so I want ...
2 votes
1 answer
1k views

Iteration over an XDocument based on some existing elements and conditions

I wrote this piece of code which works as expected: ...
2 votes
1 answer
1k views

Import huge XML data set into MongoDB while parsing data

I am currently working with the Stack Exchange Data Dump - to be more precise - with the dumped Posts.xml data set from Stack Overflow. What am I trying to achieve?...
2 votes
2 answers
1k views

Parse XML data and update values of each node's children

The code below iterates through the nodes of an XML file and updates values based on a Regex expression in the rule child node from an XPath expression. XML is ...
4 votes
2 answers
198 views

Powershell XML search performance

I am working on a utility to manage shared content libraries for Work from Home scenarios. Basically I have libraries of thousands of Autodesk Revit family files, and I want to host those files on AWS ...
3 votes
1 answer
58 views

XML Tree Reformatter requested code. C#

So this is a post as per request in a different post on stack overflow: https://stackoverflow.com/questions/62412713/why-does-my-c-sharp-xml-code-only-work-when-i-enumerate-variable-enumerable. The ...
4 votes
1 answer
559 views

HackerRank Attribute Parser

I wrote a program for solving the Attribute Parser challenge on HackerRank. The challenge is to read some specified number of lines of HTML-like markup (each line no more than 200 characters; for any ...
1 vote
2 answers
1k views

Python function to find specific regex in the text of an XML document

I'm writing a code that, starting from an XML file: stores the index of child elements of a tag and the child elements as key, values in a dictionary (function ...
2 votes
1 answer
103 views

Function to parse an XML and find specific regex considering the size attribute of the document

I'm writing a code that, starting from an XML file: stores the index of child elements of a tag and the child elements as key, values in a dictionary (function ...
2 votes
1 answer
123 views

How to divide this Python code into different functions?

I'm making a code that, starting from an xml file: stores the index of child elements of a tag and the child elements as key, values in a dictionary; deletes keys whose values contain a certain ...
5 votes
1 answer
172 views

Search for ways in OpenStreetMap extract

What does it do ? Looks in big XML files (1-3 GB) for given parameters that I need in my project, appends them to lists and finally exports both of them to the CSV files. My XML scheme I need to ...
1 vote
0 answers
34 views

XML and XML schema definition

I want to define the XML schema for an XML representation of shopping order data. See following requirements The XML representation of order should contain order id, description, request date, ...
1 vote
0 answers
44 views

Custom view to select a value

I created a Custom view to select a value. I use horizontal Recyclerview to select an integer value and 2 buttons that decrease or increase the values. Could you consider the code and tell how it can ...
3 votes
1 answer
66 views

XML attribute analysis

To begin, I have an XML file at /Users/gaze/lab/lab/gpib_lib/out.xml that contains lines like... ...
9 votes
3 answers
592 views

Performance - Read large amount of XMLs and load into single csv

I am dealing with a large amount of XML files which I obtained from here https://clinicaltrials.gov/ct2/resources/download#DownloadAllData. The download yields around 300.000 XML files of similar ...
5 votes
0 answers
2k views

Extract data from API using VBA & XML (Performance)

EDIT: Added a block with the raw code at the bottom (suggested by a friendly user) First post here. I sincerely hope that I am doing everything by the book. Also, I want to thank you in advance for ...
1 vote
0 answers
52 views

Improving loop through xml files ad add to DF

With this code, i loop through similar xml files and add them to a DataFrame. How can i make this code better so it is more pythonic? ...
1 vote
1 answer
343 views

File size when parsing XML

The code below takes a directory of XML files and parses them into a CSV file. Right now parsing around 60 XML files is fast and the output is a CSV file that is around 250MB. That is a really big ...
3 votes
0 answers
66 views

OOP parsing for DB dump XML Python

I am parsing large XML (DB dump). So, the content looks like many different objects with their properties and dependencies (foreign keys). My way to do it - using lxml.etree (iterparse): ...
1 vote
0 answers
2k views

Escaping invalid XML characters (e.g. for the Java DOM API)

I want to save and load an arbitrary Java String in a Text node in a XML file using the Java DOM API. The ...
4 votes
1 answer
458 views

TextView vs Button for Android AlertDialog

I want to open an AlertDialog on the click of either a Button or TextView but I am not sure ...
4 votes
1 answer
566 views

Displaying text extracted from XML using PHP simplexml

I have this xml file and i am parsing it with php simplexml. My XML file looks like this: ...

1
2 3 4 5
9