Skip to main content
9 votes

Efficient structure for XML manipulation

I'm going to focus on the convenience part of the question. jsoupLink can work well for a lot of situations. Let's say, for example, that we want to parse RSS. RSS is an XML format, so we can do it ...
C. E.'s user avatar
  • 70.9k
6 votes

Markdown parser in Mathematica

To get the ball rolling, here's my incomplete parser. And here's a minimal markdown sample. This is what my markdown parser makes of it, used like so: ...
b3m2a1's user avatar
  • 47k
6 votes
Accepted

Converting between XML and JSON?

It's not clear how XML can be converted to JSON in a general way, because how would one deal with attributes? You happen not to have attributes in your XML, but that's just a special case. Luckily, ...
C. E.'s user avatar
  • 70.9k
6 votes
Accepted

XML, select several values

You can capture all consecutive events like this: ...
Sjoerd Smit's user avatar
5 votes

Converting between XML and JSON?

I've not been involved with XML lately, but I used to (re)define XMLObject and XMLElement to process an XML structure. It's ...
Michael E2's user avatar
  • 239k
5 votes

Pulling Out Values from JSON Association

First of all, I think you can make your life a bit easier by using RawJSON as input format specification. It basically makes Mathematica use Associations where appropriate when importing JSON. ...
Samuel Novák's user avatar
5 votes

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

If you look at the URL that you found, you'll notice a parameter pn. If you change this parameter you get another set of t-shirts. To get all t-shirts you need to ...
C. E.'s user avatar
  • 70.9k
5 votes
Accepted

Adding MathML export rules

Expanding my comment into a concrete answer: Using GeneralUtilities`PrintDefinitions to look at the functions responsible for the ...
Lukas Lang's user avatar
  • 34.2k
4 votes

Import iTunes xml data and convert it into a dataset or table

Had to add the "ReadDTD" -> False option to ...
Dave's user avatar
  • 258
4 votes

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

To make this work, you need to specify the format. There is no "XMLObject" format. "XMLObject" is an import element for the <...
Szabolcs's user avatar
  • 236k
4 votes

Repeated pattern in XMLElement

Cases[xml,XMLElement["forename" | "surname", _, x_] :> x, \[Infinity]] (* {{"Adrian"}, {"Adgar"}, {"Babar"}, {"Barbados"}, {"Bode"}, \ {"Charly"}, {"Chimp"}} *) ...
Mike Honeychurch's user avatar
4 votes
Accepted

Subsequence Search

I don't know how extensible this is, but it works for your case, ...
Jason B.'s user avatar
  • 69.2k
4 votes

Efficient structure for XML manipulation

C.E.'s answer is probably the best, relying as it does on a well-constructed Java library with serious people behind it, but I thought it'd be nice to have a pure Mathematica solution as well, so I ...
b3m2a1's user avatar
  • 47k
4 votes
Accepted

Generic XML to Dataset

This is one way: xml = ImportString["the provided complete xml", "XML"]; Part 2 of the imported xml the actual data skipping the xml version ...
Gustavo Delfino's user avatar
3 votes
Accepted

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

This behaviour seems to come down to a bug in how the x3d exporter writes down the colours for the mesh. The x3d file is simply a specialized xml document, and it can be opened in a text file. This ...
Emilio Pisanty's user avatar
3 votes
Accepted

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

Trace reveals that XML`MathML`BoxesToSymbolicMathML is used under the hood and it has an ...
Kuba's user avatar
  • 137k
3 votes

Converting between XML and JSON?

Perhaps you can pre-process your data before feeding it in Mathematica? If so, I'd suggest you consider Data Transformer (disclaimer - I'm its developer). It offers a number of conversion settings (...
Geo Systems's user avatar
3 votes
Accepted

Extracting blocks of "adjacent" XMLElements

...
Mike Honeychurch's user avatar
3 votes
Accepted

Error importing JSON in 11.3 (worked in 11.2)

There is a way to fix the invalid UTF8 using: FromCharacterCode[ToCharacterCode[_String, "UTF-8"]] Then use ImportString on ...
Aaron Enright's user avatar
3 votes

Repeated pattern in XMLElement

A minimal example showing why the original Cases doesn't work, ...
Jason B.'s user avatar
  • 69.2k
3 votes
Accepted

Include comments in exported XML file

We can use the construction XMLObject["Comment"]["..."]. This is described in detail in this tutorial. For example... ...
WReach's user avatar
  • 69.1k
3 votes
Accepted

Can I use StringExpression or RegularExpression to manipulate Symbolic XML?

You should use Condition with StringMatchQ: ...
Alexey Popkov's user avatar
3 votes

In a function definition, how should I declare an XMLObject["Document"] argument?

This is a syntax issue with the pattern notation. Consider this from your f3: ...
lericr's user avatar
  • 30.5k
3 votes
Accepted

How to Import MusicXML Files?

It's an ordinary XML format, so you can import it as XML via Import. You only have to disable reading the DTD file, because the ...
Domen's user avatar
  • 27.7k
2 votes

Markdown parser in Mathematica

The package "Markdown2WL" attempts that, but unfortunately it is fairly incomplete. Also, see the corresponding Community post. (In general I like the idea of a Markdown-to-Mathematica ...
Anton Antonov's user avatar
2 votes

Parsing and Extracting XML Content

...
Kuba's user avatar
  • 137k
2 votes
Accepted

Select the right XMLelement

My guess as to what you want: ...
Mr.Wizard's user avatar
  • 272k
2 votes
Accepted

Parallel XML import

I found a partial soulution by myself. When I used ParallelDo all kernels have the same settings. In Parallel Kernel Configuration I create a couple of new kernels. This are Master Kernels. Every one ...
VasilySH's user avatar
2 votes

Subsequence Search

This also works for your list, but like Jason B, I don't that is will be applicable to your XML problem. ...
m_goldberg's user avatar
  • 108k
2 votes

How to extract data and attribute data from an XMLElement

I think that using Cases to break apart XML is probably not the right way to go. When working with the nested structure like this, the natural approach is to use ...
Mike Colacino's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible