# Convert text (data) to xml structure format

**URL:** https://forum.kirupa.com/t/convert-text-data-to-xml-structure-format/289233
**Category:** flash
**Created:** [May 27, 2009, 8:09pm UTC](https://forum.kirupa.com/t/convert-text-data-to-xml-structure-format/289233 "2009-05-27T20:09:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![minopharma](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@minopharma](https://forum.kirupa.com/u/minopharma)
#### Post date: [May 27, 2009, 8:09pm UTC](https://forum.kirupa.com/t/convert-text-data-to-xml-structure-format/289233/1 "2009-05-27T20:09:31Z")

</div>

Hi to all! This is my first post in this forum and I’ll try to best explain my problem.

I’m working on a AS3(AIR) application, i.e., some text transposer. Let’s say I have a dynamic textbox (some previously transposed data), in which I have the following content:

```php

-1.66419
-1.65539
-1.63308
-1.47002
-1.42859
 1.00165
 1.00633
 1.00963
 1.01368
 1.01833

```

Next to this text box, I have another dynamic text box, where I want to put these numeric values, i.e., to generate an XML tree by clicking a button (calling a function), which have the following structure:

```php

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<values id="cpnn" minv = "0.00" intv = "0.50" maxv= "1.00">
  <val>
    <caption>-1.66419</caption>
  </val>
  <val>
    <caption>-1.65539</caption>
  </val>
  <val>
    <caption>-1.63308</caption>
  </val>
  <val>
    <caption>-1.47002</caption>
  </val>
  <val>
    <caption>-1.42859</caption>
  </val>
  <val>
    <caption>1.00165</caption>
  </val>
  <val>
    <caption>1.00633</caption>
  </val>
  <val>
    <caption>1.00963</caption>
  </val>
  <val>
    <caption>1.01368</caption>
  </val>
 <val>
    <caption>1.01833</caption>
  </val>
<values/>

```

How can I do that? Is there a solution? If someone have a solution, or in better case a source file, I’ll be very grateful!

Thanks in advance,  
Nikola
