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

learn more… | top users | synonyms

2
votes
1answer
46 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 ...
1
vote
2answers
86 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: ...
5
votes
1answer
75 views
2
votes
1answer
50 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. ...
10
votes
3answers
129 views
3
votes
1answer
68 views

Whitespace is lost during MathML -> XMLElement conversion

ImportString["<mtext> </mtext>", {"MathML", "XMLElement"} ] XMLElement["mtext",{},{}] while I'd expect: ...
1
vote
0answers
39 views
4
votes
3answers
179 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. ...
5
votes
4answers
254 views

Finding relevant parts in XML document

My question is about a XML document and finding parts of strings. test = Import["C:\\Users\\filename.xml", "XMLObject"] This gives the following output: ...
5
votes
1answer
70 views

Export XMLElements with MathML contents

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

Get determinate values from XML [duplicate]

The following code gets a xml file with too much attributes of a car, but I want some of them only, what is the best way to do it? ...
1
vote
0answers
41 views

Problem of importing some special characters in HTML

content of the html file is as follows: <p> 被尊称为&ldquo;高贵的&rdquo; </p> method1: ...
11
votes
1answer
434 views

How can I set id attribute of elements when I export an SVG file?

Suppose I have a Mathematica graphic such as g = Graphics[{Disk[{-1, 0}, 1/2], Rectangle[]}] I would like to be able to export this graphic from Mathematica ...
0
votes
1answer
95 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
vote
1answer
91 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 ...
7
votes
1answer
494 views

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

I have an xml file with song data from iTunes (https://dl.dropboxusercontent.com/u/1012958/iTunes%20Library.xml) and I'd like to import it to Mathematica to do some statistics. I get an XMLObject like ...
4
votes
1answer
201 views

Importing malformed XML: Import[… “XMLObject”] vs ImportString[…, “XML”]

It appears that Import[ url , "XMLObject" ] is more forgiving of improperly formatted XML than ImportString[ string, "XML"]. For ...
9
votes
1answer
219 views

CSS Selectors for Symbolic XML

Symbolic XML is a convenient way of managing XML in Mathematica, at least for casual use or small tasks. Here and elsewhere you can find examples of XML handling in Mathematica, including XSLT/XPath ...
6
votes
1answer
210 views

Avoiding overcomplicated structure of groups, masks and splited text on vector format plot export

I'm trying to generate a template for exporting figures and plots in a consistent way that will allow easy editing in any vector based drawing software (such as illustrator). My problem is that ...
6
votes
2answers
654 views

How to import a “.numbers” spreadsheet?

Does Mathematica support importing a ".numbers" spreadsheet file (from the "Numbers" '09 (ver. 2.3 554) spreadsheet program in Apple's OS X iWork office suite)? A ".numbers" file is actually a zip ...
1
vote
1answer
166 views

Exporting XML Data

I am trying to convert a bunch of text files into structured XML files. Using string expressions I have extracted data, so I have: ...
6
votes
1answer
596 views

What is the proper way to extract XMLElement values?

I have seen and tried many different versions of XML data parsing here on this forum, and even some in the documentation. Is there a tried and true "Best Practice" way to extract all the XMLElement ...
1
vote
1answer
1k views

Extract attribute data from an XMLElement

I'm trying to come to grips with parsing an XML file but I'm having difficulty working out how to extract specific attribute data from an XMLElement. Sample XML file below: ...
1
vote
1answer
756 views

Importing formatted, highlighted text from : HTML vs RTF vs. XML

We would like the ability to import and analyze ASCII documents that have been manually segmented by highlighting and changing font colors of various sections, eg: The original line breaks, ...
8
votes
1answer
488 views

Converting XMLElement objects to plain text

Short version: How can I convert an XMLElement that represents part of a HTML document to plain text? Long version: The more general problem is extracting ...
0
votes
1answer
141 views

Importing RSS to Notebook: How to get images instead of long ugly links?

This question on importing news headlines via a RSS feed reminded me of an old question I've been meaning to ask. Past attempts at finding a use for Mathematica's RSS to Notebook capabilities were ...
6
votes
1answer
771 views

Import numeric values from XML

I am trying to import data from an XML file and then perform calculations on those numeric values. When I import the data the values seem to be stored as strings. I tried using a ToExpression ...
8
votes
1answer
1k views

Why does Export drop namespace prefixes in the exported XML file?

I am trying to generate an Excel-compatible XML file from Mathematica. First, I created a test XML file by saving a Microsoft Excel workbook as "XML Table". Then I ...
5
votes
0answers
290 views

Consuming a SOAP service that requires a complexType authentification header

Short version: Why do I get a $RecursionLimit error when calling NewSchemaInstance[SomeInstalledType] and how do I fix it? ...
14
votes
3answers
1k views

How to scrape the headlines from New York Times and Wall Street Journal?

How to scrape headlines from New York Times, Wall Street Journal main pages to create datasets similar to this service? Importing HTML from nyt.com (HTML4) results in a ...
10
votes
2answers
311 views

Why doesn't Cases match all instances of XMLElement, given Infinity levelspec?

Why doesn't Cases match all instances of XMLElement, given Infinity levelspec? ...