# Very strange xml output + mysql + xpath

**URL:** https://forum.kirupa.com/t/very-strange-xml-output-mysql-xpath/195179
**Category:** Uncategorized
**Created:** [July 29, 2006, 9:26am UTC](https://forum.kirupa.com/t/very-strange-xml-output-mysql-xpath/195179 "2006-07-29T09:26:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nitras](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nitras/32/1475_2.png) [@nitras](https://forum.kirupa.com/u/nitras)
#### Post date: [July 29, 2006, 9:26am UTC](https://forum.kirupa.com/t/very-strange-xml-output-mysql-xpath/195179/1 "2006-07-29T09:26:00Z")

</div>

hello there

i am using flash to fill a database with some info  
i use querries to load the info from the db and put this into an xml  
the basic idea is  
\> check for items in db  
\> display them in flash trough php & xml  
\> when pressed on THIS item, you can update it’s content and send back to db  
(the updating functions & code arn’t layed out here, tested it and it’s works)

my problem is that i can trace EACH attribute execpt the ID

here are some code snippets, important to follow

//the php file on how i get my info from the db

```auto

<?PHP
include 'data.php';
$query = 'BLANKED OUT';
$results = mysql_query($query);
echo "<?xml version=\"1.0\"?>
";
echo "<list>
";
while($line = mysql_fetch_assoc($results)) {
    echo ("<Client_id='" . $line["Client_id"] . "' Client_name='" . $line["Client_name"] . "' Client_adress='" . $line["Client_adress"] . "' Client_contact='" . $line["Client_contact"] . "' Client_desc='" . $line["Client_desc"] . "'/>
");
    }

echo "</list>
";
mysql_close($dbc);
?>

```

this works pretty nice and gives me in the browser output:

```auto

<list>
<Client_id='1' Client_name='Mentallab' ... and so on
...
...

```

as you can see every attribute has single quotes

BUT when i enter flash and trace the output from my xpath array lets take a look;

```auto

//take from the code
my_path= "/list/*";
my_array = mx.xpath.XPathAPI.selectNodeList(this.firstChild, my_path);
trace ("a = " + my_array)//traces array
trace ("ats = " + my_array.toString())//traces array to string

```

with the bizar outcome :

```auto

//array trace
<list><Client_id='1' Client_name="Mentallab" 

//array to string trace
<list><Client_id='1' Client_name="Mentallab" 

```

so both are equal, yet the id has single quotes ’ 'and the others have double quotes " "

THIS leads to my problem

i really need the id for each item to update these  
so i need the correct ID from the database fe the outcome could be (14,33,156,…)

now when i fill in my for loop text properties & attributes it’s gets even more weird

i know i am partly doig it correct cuz all my other info is correct

fe.

```auto

//filling mc's text with info from the array
Client_id.btn_txt.text = "the id "+my_array[p].attributes.Client_id; //displays undefined...
Client_name.btn_txt.text = "the name " + my_array[p].attributes.Client_name; // displays correct

```

so my problem is that i can trace ALL other attributes from the array EXECPT the id  
it gives me undefined

plz i’d like to call on some help here, i am looking blind on this one  
in hope i’ve posted it as clear as possible

kind regards
