Questions tagged [xml]

Questions on the use of Mathematica to import, modify, and export XML documents.

Filter by
Sorted by
Tagged with
1 vote
1 answer
62 views

WolframAlpha XML parsing error

I am using the WolframAlpha command to automated solution sets of homework exercises. Here is an sample usage, although this can happen with many different examples:...
4 votes
1 answer
89 views

How to work around HTML not importing full HTML as XMLObject

I'm trying to parse some data out of the HTML for a form. Here's a simple one ...
  • 45.9k
3 votes
1 answer
149 views

Generic XML to Dataset

I am having trouble to transform XML data into a Mathematica Dataset of Associations. I want a dataset that follows the structure of the XML file with all its sublevels. Here is the example xml: ...
0 votes
0 answers
31 views

Use Graphics in a XM-Template

I'm trying to make a Form that outputs a few matrices, and I figured I'd use an XML-Template to format the output. Here is a minmal example of the problem. I'd like a Matrix output as in: ...
1 vote
2 answers
67 views

Parsing data from site

I try parse hub titles and links from this site: https://habr.com/en/hubs/, but code returns empty list. Can not understand why. ...
4 votes
1 answer
86 views

XML, select several values

I import a XML file, using: xmldatatest = Import["C:\\...\\...\\name.xml", {"XML", "XMLObject"}, "ReadDTD" -> False] ...
1 vote
2 answers
211 views

How to extract data and attribute data from an XMLElement

I am trying to write a function to extract both the data and the attribute data from an XMLElement in the same pass. I have followed the examples from Mathematica's Transforming XML tutorial and the ...
  • 187
5 votes
1 answer
86 views

Adding MathML export rules

Prior to v12.1 Row was not handled well by MathML export: Now it is ok: ExportString[Row[{1}], "MathML"] ...
  • 134k
3 votes
1 answer
60 views

How to exclude annotation encoding='Mathematica' from generated MathML?

I do not see how to remove <annotation encoding='Mathematica' from generated MathML. Afaict it is not needed for a one way conversion and it often doubles the ...
  • 134k
1 vote
2 answers
79 views

How to read list of UnsignedInteger16 from base64 string in mathematica

I am struggling to convert a base64 string to a list of UnsignedInteger16 values. I have limited experience with mathematica, so please excuse me if this should be obvious. I read the base64 string ...
4 votes
1 answer
166 views

The rendering of plot meshes on exported x3d files is inconsistently rendered by different browsers

I'm exporting some plots from Mathematica into x3d for display on the web, and I'm having some trouble getting the plot mesh to display consistently. I believe this behaviour is ultimately a bug on ...
0 votes
0 answers
65 views

The graph output of an xml format and the output of Mathematica

Based on below command: ...
  • 1,465
2 votes
0 answers
43 views

How to select a part from a list of text imported from the internet

I import a dataset from the internet like: data=Import["http://www.test.com", {"HTML", "XMLObject"}] The dataset looks like this: ...
4 votes
3 answers
233 views

Converting between XML and JSON?

I can't seem to find a way to convert between an XML string and RawJSON: ...
  • 30.9k
1 vote
1 answer
32 views

MathML interpreter returns failure on valid expression

I have the following expression ...
1 vote
1 answer
97 views

Parallel XML import

I need to import some xml information from many pages. I have list of this pages. Doing it in single thread is too long. But I can't access multiple pages from the same IP at the same time. So I need ...
4 votes
3 answers
100 views

Subsequence Search

I need to parse some xml code. I need to extract some values withing pattern elements. I made an example of my trouble. Here is some complicated xml list: ...
10 votes
2 answers
307 views

Efficient structure for XML manipulation

I'm interested in working with XML more conveniently and efficiently than I currently can. The standard XMLDocument/XMLElement ...
  • 45.9k
2 votes
1 answer
104 views

Select the right XMLelement

I scrape data from a public website about houses for rent. All pages have the same structure. But the pages can differ in the amount of information. Below I give two examples: page/house 1: ...
3 votes
1 answer
393 views

Error importing JSON in 11.3 (worked in 11.2)

EDIT : Originally posted as an XML issue, file format was found to be actually JSON, yet the problem is essentially the same: Import worked in 11.2 but not in 11.3. As per Hans' comments, replicated ...
  • 14.9k
0 votes
0 answers
191 views

Import Stackoverflow data and convert it into dataset

I have an xml file with the tag data from Stackexchange: https://archive.org/download/stackexchange/stackoverflow.com-Tags.7z After I unzip it I would like to import it to Mathematica to some ...
2 votes
2 answers
163 views

Repeated pattern in XMLElement

I have an XML file like this: ...
  • 13.9k
1 vote
1 answer
83 views

Extracting blocks of "adjacent" XMLElements

I have a file that, when imported as an "XMLObject", returns an XML object that possesses this general structure: (I've stripped the inconsequential junk wrapping ...
  • 1,581
0 votes
1 answer
158 views

Import XML link from ECB and extract time series

I would like to extract the time series from a XML link provided by the ECB. Unfortunately, I am not able to extract the data time series. May someone be able to help me please? I start to import the ...
0 votes
1 answer
101 views

ToExpression Error when parsing MathML in XML

My code for parsing MathML to be readable in Mathematica: ToExpression @ ImportString @ ExportString[#, "XML"]& /@ Cases[ xml, XMLElement["math", _, _],∞ ] ...
4 votes
1 answer
145 views

Import from url question -- "Cannot import data as Graph6 format"

When I import url, there will show the folling message: "Cannot import data as Graph6 format" The codes as following: ...
  • 871
1 vote
1 answer
88 views

Filter Information form XML format file

I want filter information from a .xml file, from elements that look like this: ...
  • 871
11 votes
2 answers
360 views

Markdown parser in Mathematica

Is there already a markdown to XML parser implemented in Mathematica? I wrote a one for my pelican rewrite, but realized I should have asked here first. Mine is almost certainly faulty in a few major ...
  • 45.9k
1 vote
0 answers
95 views

Scraping XML Paragraphs with URLs

I've been working on scraping an article from CNBC. The link is here I want to scrape the main body, and the code I have so far is this: ...
0 votes
0 answers
198 views

How can I convert urls to an IE bookmark

I've wrote a program notebook to convert chrome bookmark html to new chrome bookmark html, and it can also be imported into IE favorites. One can test it in your own chrome bookmark html[need do ...
  • 8,379
3 votes
1 answer
502 views

Pulling Out Values from JSON Association

Having a bit of trouble pulling a value out of a JSON Association here. I am scraping this website: http://www.msn.com/en-us/money/stockdetails/history/fi-126.1.BY.NYS I want to scrape the closing ...
1 vote
0 answers
89 views

Using Two Arguments on the Same Function

I'm having some trouble wrapping my head around how I would go about using two arguments in one function. In the first section of the code below, I have scraped some "tweets" on the Seeking Alpha ...
1 vote
1 answer
84 views

Extracting Certain Areas of JSON

I've been working with some web scraping and have run into a wall. The website I'm working with is this: https://seekingalpha.com/symbol/TWLO/stocktalks I am trying to scrape all of the "stock talks" ...
2 votes
1 answer
480 views

Parsing and Extracting XML Content

I've run into a little question while trying to parse XML. This seems like a rather simple task, but for the life of me I cannot figure it out. I pull up the XML of the website using the following ...
3 votes
1 answer
79 views

Include comments in exported XML file

When exporting an XMLObject (using Export/ExportString), is there any way to include a ...
  • 229k
5 votes
1 answer
541 views

Is it possible to grab all the links at once on a webpage?

I'm working with some webscraping using Mathematica and have run into a question: is it possible to grab all the links on a webpage that scrolls down? The page I am trying to scrape is this: "http://...
0 votes
2 answers
109 views

Can I use StringExpression or RegularExpression to manipulate Symbolic XML?

Please, consider an XML document containing these fields: ...
4 votes
1 answer
295 views

How to validate an XML file against xsd in Wolfram language?

I am planning to write a package to read data which is saved in XML format that should follow some XML schema. As part of the reading I would like to do error checking, namely schema validation. So is ...
  • 325
1 vote
2 answers
168 views

Void elements / self closing tags export to HTML

There are some built in rules in exporting that automatically create Void elements / self closing tags for some tags: ...
  • 134k
5 votes
1 answer
166 views

Custom rules for expressions in export to HTML(Fragment)

ExportString[Grid[{{a, b}}], "HTMLFragment"] ...
  • 134k
4 votes
1 answer
102 views

Whitespace is lost during MathML -> XMLElement conversion

ImportString["<mtext> </mtext>", {"MathML", "XMLElement"} ] XMLElement["mtext",{},{}] while I'd expect: ...
  • 134k
10 votes
3 answers
168 views

Unwanted extra spaces at HTML tag boundaries when using ImportString

What causes the following unexpected behavior? ...
  • 919
1 vote
1 answer
205 views

Error when importing XML - XMLGetString::pserr: MalformedURLException

I am getting the following error when trying to import XML: ...
5 votes
3 answers
357 views

Convert `FullForm` to XML Structure and back

How might I create a function that converts between FullForm and a XML structuce? Ultimately I'm ideally looking to use CSS and JS to edited the XML structure. ...
  • 7,501
5 votes
1 answer
183 views

Export XMLElements with MathML contents

Setup Here's my mathML expression: mathML = ExportString[1/2, "MathML"] ...
  • 134k
2 votes
0 answers
122 views

Importing HTML loses the Nested tags relation

...
  • 8,379
2 votes
0 answers
67 views

Problem of importing some special characters in HTML

content of the html file is as follows: <p> 被尊称为&ldquo;高贵的&rdquo; </p> method1: ...
  • 8,379
0 votes
1 answer
288 views

Simplify an XMLObject by keeping only specific elements

I would like to extract from an XMLObject only the XMLElements with a specific tag. Inspired from the Mathematica help (section transforming XML, introduction, the example with the colours), I have ...
  • 1,069
3 votes
1 answer
122 views

Transform an XMLObject with XMLElements with empty attributes

I would like to transform a an XMLObject so as to replace all the non empty attributes of the XMLElements by empty attributes. ...
  • 1,069
1 vote
1 answer
223 views

Retrieve XML Tree with only specific XMLElements

I would like to retrieve the XML Tree of a XMLObject with only specific XMLElements. In the help of Mathematica TransformingXML,...
  • 1,069