Re: [flexcoders] quick XML question

2009-11-17 Thread thomas parquier
Hello,

Most e4x methods return xmllist not xml. I think the following should work :

> var n1 : XML = report.system["product-name"][0];


thomas
---
http://www.web-attitude.fr/
msn : thomas.parqu...@web-attitude.fr
softphone : sip:webattit...@ekiga.net 
téléphone portable : +33601 822 056


2009/11/17 Pruitt, Byron S 

>
>
>  Found an article online reporting the dashes are a problem in E4X
> syntax.  http://www.insideria.com/2009/01/flex-xml-quick-tip.html if
> anyone is interested.
>
>
>
> However it addresses the problem of…
>
>
>
> dg.dataProvider = xmlDataSource.data-one;
>
>
>
> And recommends…
>
>
>
>  dg.dataProvider = xmlDataSource["data-one"];
>
>
>
> But in my problem, I do not explicitly state a dash in my syntax.  I
> expanded my experiment a little and defined report to be
>
>
>
> var report : XML =
> ………
>
>
>
> and tried
>
>
>
> var n1 : XML = report.system["product-name"] as XML;
>
> and n1 is null.
>
>
>
> Still confused.
>
>
>
> -S
>
>
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *claudiu ursica
> *Sent:* Tuesday, November 17, 2009 2:09 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] quick XML question
>
>
>
>
>
> I think the - is the issue. There is a solution for
> this but i cannot remember where i read about it. Do some google-ing...
>
> C
>
>
>  --
>
> *From:* "Pruitt, Byron S" 
> *To:* "flexcoders@yahoogroups.com" 
> *Sent:* Tue, November 17, 2009 8:29:22 PM
> *Subject:* [flexcoders] quick XML question
>
>
>
> I have a variable named report set to an xml document.
>
>
>
> var report : XML =
> ………
>
> var n1 : XML = report.system as XML;
>
> var n2 : XML = report.children( )[0];
>
>
>
> n1 = null
>
> n2 = the system node
>
>
>
> I have accessed nodes many times like I do for n1 and not a problem with it
> evaluating to null.  I can’t figure out what I am doing differently with the
> above.
>
> Any help showing me the obvious is appreciated.
>
>
>
>
>
> -Steve
>
>
>
>
>
>   
>


Re: [flexcoders] quick XML question

2009-11-17 Thread claudiu ursica
Can you post your detailed xml ?
I'll have a quick look in the morning...
C





From: "Pruitt, Byron S" 
To: "flexcoders@yahoogroups.com" 
Sent: Tue, November 17, 2009 10:01:48 PM
Subject: RE: [flexcoders] quick XML question

   
Found
an article online reporting the dashes are a problem in E4X syntax.  
http://www.insideri a.com/2009/ 01/flex-xml- quick-tip. html if anyone is 
interested.
 
However
it addresses the problem of… 
 
dg.dataProvider = xmlDataSource.data-one;
 
And recommends…
 
 dg.dataProvider = xmlDataSource["data-one"];
 
But in my problem, I do not explicitly state a
dash in my syntax.  I expanded my experiment a little and defined report to be
 
var
report : XML = 
………
 
and tried
 
var n1 :
XML = report.system["product-name"] as XML;
and n1 is
null.
 
Still
confused.
 
-S
 
 
From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of claudiu
ursica
Sent: Tuesday, November 17, 2009 2:09 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] quick XML question
 
  
I
think the - is the issue. There is a
solution for this but i cannot remember where i read about it. Do some
google-ing.. .

C
 


 
From:"Pruitt, Byron
S" 
To: "flexcod...@yahoogro ups.com" 
Sent: Tue, November 17, 2009 8:29:22 PM
Subject: [flexcoders] quick XML question

  
I have a variable named report set to an xml document.
 
var report : XML =
………
var n1 : XML = report.system as XML;
var n2 : XML = report.children( )[0];
 
n1 = null
n2 = the system node
 
I have accessed nodes many times like I do for n1 and
not a problem with it evaluating to null.  I can’t figure out what I am
doing differently with the above.
Any help showing me the obvious is appreciated.
 
 
-Steve
 
 
 


  

RE: [flexcoders] quick XML question

2009-11-17 Thread Pruitt, Byron S
Found an article online reporting the dashes are a problem in E4X syntax.  
http://www.insideria.com/2009/01/flex-xml-quick-tip.html if anyone is 
interested.



However it addresses the problem of…



dg.dataProvider = xmlDataSource.data-one;



And recommends…



 dg.dataProvider = xmlDataSource["data-one"];



But in my problem, I do not explicitly state a dash in my syntax.  I expanded 
my experiment a little and defined report to be



var report : XML = 
………



and tried



var n1 : XML = report.system["product-name"] as XML;

and n1 is null.



Still confused.



-S


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of claudiu ursica
Sent: Tuesday, November 17, 2009 2:09 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] quick XML question


I think the - is the issue. There is a solution for this 
but i cannot remember where i read about it. Do some google-ing...

C


From: "Pruitt, Byron S" 
To: "flexcoders@yahoogroups.com" 
Sent: Tue, November 17, 2009 8:29:22 PM
Subject: [flexcoders] quick XML question


I have a variable named report set to an xml document.

var report : XML = ………
var n1 : XML = report.system as XML;
var n2 : XML = report.children( )[0];

n1 = null
n2 = the system node

I have accessed nodes many times like I do for n1 and not a problem with it 
evaluating to null.  I can’t figure out what I am doing differently with the 
above.
Any help showing me the obvious is appreciated.


-Steve





Re: [flexcoders] quick XML question

2009-11-17 Thread claudiu ursica
I think the -is the issue. There is a solution for this 
but i cannot remember where i read about it. Do some google-ing...

C





From: "Pruitt, Byron S" 
To: "flexcoders@yahoogroups.com" 
Sent: Tue, November 17, 2009 8:29:22 PM
Subject: [flexcoders] quick XML question

   
I
have a variable named report set to an xml document.
 
var report : XML = ………
var n1 : XML = report.system as XML;
var n2 : XML = report.children( )[0];
 
n1 = null
n2 = the system node
 
I have accessed nodes many times like I do
for n1 and not a problem with it evaluating to null.  I can’t figure
out what I am doing differently with the above.
Any help showing me the obvious is
appreciated.
 
 
-Steve
 
 


  

[flexcoders] quick XML question

2009-11-17 Thread Pruitt, Byron S
I have a variable named report set to an xml document.

var report : XML = 
.
var n1 : XML = report.system as XML;
var n2 : XML = report.children()[0];

n1 = null
n2 = the system node

I have accessed nodes many times like I do for n1 and not a problem with it 
evaluating to null.  I can't figure out what I am doing differently with the 
above.
Any help showing me the obvious is appreciated.


-Steve