2
$\begingroup$

This question already has an answer here:

In a notebook, I import an XMLObject from a html file with this code line :

XMLData = 
  Import["Z:/XXX/XXX/XXX.mw", "XML"];

In order to have all the data in the notebook, is it possible to save the XMLObject inside th notebook so that for future uses, it is possible to not import the XMLObject.

The idea is to permit to send to somebody a notebook with all the data inside and not a notebook and a html file.

Thank you for your help.

$\endgroup$

marked as duplicate by Kuba, bbgodfrey, Ajasja, dr.blochwave, m_goldberg May 26 '15 at 16:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

6
$\begingroup$

You can store the data using tagging like so:

XMLData = Import["Z:/XXX/XXX/XXX.mw", "XML"];
SetOptions[EvaluationNotebook[], TaggingRules -> {"xmlData" -> XMLData}]

Then in future it can be recalled in the same notebook using the following line. (The tagged data can be recalled even if the code above is deleted.)

XMLData = CurrentValue[{TaggingRules, "xmlData"}]
$\endgroup$
  • $\begingroup$ XMLData = Import["Z:/XXX/XXX/XXX.mw", "XML"]; SetOptions[EvaluationNotebook[], TaggingRules -> {"xmlData" -> XMLData}] XMLData = CurrentValue[{TaggingRules, "xmlData"}] I compile these 3 lines one time After i try to suppress the first line linked to the import of my data XMLData = Import["Z:/XXX/XXX/XXX.mw", "XML"];, I can retrieve my data. Do you have any suggestion so as to I can correct my process ? $\endgroup$ – Bendesarts Jun 1 '15 at 7:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.