[Flashcoders] XPATH Question

2006-03-01 Thread julian atienza
I have this XML
Localidades
 Localidad
idLocalidad type=number83/idLocalidad
   idProvincia type=number34/idProvincia
   idComunidadAutonoma type=number15/idComunidadAutonoma
/Localidad
Localidad
idLocalidad type=number106/idLocalidad
   idProvincia type=number35/idProvincia
   idComunidadAutonoma type=number15/idComunidadAutonoma
/Localidad
/Localidades


And want to generate a XPATH to select all nodes that f.e,  are  from 
idLocalidad=83  OR with  idComunidadAutonoma = 15

that query that i will made with a SELECT in SQL

SELECT * FROM LOCALIDADES
WHERE idLocalidad = 83 OR idComunidadAutonoma = 15

¿¿is it possible??

i'm trying with a lot of things like

Localidades/Localidad[idLocalidad = 83] |
Localidades/Localidad[idComunidadAutonoma = 15];

but it returns 3 elements (1 for idLocalidad = 83, and two for
idComunidadAutonoma, when i really would like to receive 2...

thanks in advance
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] XPATH Question

2006-03-01 Thread kada zuro
try using or for the xpath query
Localidades/Localidad[idLocalidad=83 or idComunidadAutonoma=15]

sample:

import mx.xpath.XPathAPI;
z = new XML('LocalidadesLocalidadidLocalidad
type=number83/idLocalidadidProvincia
type=number34/idProvinciaidComunidadAutonoma
type=number15/idComunidadAutonoma/LocalidadLocalidadidLocalidad
type=number106/idLocalidadidProvincia
type=number35/idProvinciaidComunidadAutonoma
type=number15/idComunidadAutonoma/Localidad/Localidades');
var thePath_str:String = Localidades/Localidad[idLocalidad=83 or
idComunidadAutonoma=15];
var result_array:Array = XPathAPI.selectNodeList(z.firstChild,thePath_str);
for (var i:Number = 0; i  result_array.length; i++) {
trace(result_array[i].firstChild.toString());
}

i'm just tracing out the firstChild but the query will contain the whole node.

regards.
kada.


On 3/1/06, julian atienza [EMAIL PROTECTED] wrote:
 I have this XML
 Localidades
  Localidad
 idLocalidad type=number83/idLocalidad
idProvincia type=number34/idProvincia
idComunidadAutonoma type=number15/idComunidadAutonoma
 /Localidad
 Localidad
 idLocalidad type=number106/idLocalidad
idProvincia type=number35/idProvincia
idComunidadAutonoma type=number15/idComunidadAutonoma
 /Localidad
 /Localidades


 And want to generate a XPATH to select all nodes that f.e,  are  from 
 idLocalidad=83  OR with  idComunidadAutonoma = 15

 that query that i will made with a SELECT in SQL

 SELECT * FROM LOCALIDADES
 WHERE idLocalidad = 83 OR idComunidadAutonoma = 15

 ¿¿is it possible??

 i'm trying with a lot of things like

 Localidades/Localidad[idLocalidad = 83] |
 Localidades/Localidad[idComunidadAutonoma = 15];

 but it returns 3 elements (1 for idLocalidad = 83, and two for
 idComunidadAutonoma, when i really would like to receive 2...

 thanks in advance
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] XPATH Question

2006-03-01 Thread Chris Allen
Try this:

/Localidades/Localidad[idLocalidad='83' or idComunidadAutonoma='15']

That should work for you.

On 3/1/06, julian atienza [EMAIL PROTECTED] wrote:
 I have this XML
 Localidades
  Localidad
 idLocalidad type=number83/idLocalidad
idProvincia type=number34/idProvincia
idComunidadAutonoma type=number15/idComunidadAutonoma
 /Localidad
 Localidad
 idLocalidad type=number106/idLocalidad
idProvincia type=number35/idProvincia
idComunidadAutonoma type=number15/idComunidadAutonoma
 /Localidad
 /Localidades


 And want to generate a XPATH to select all nodes that f.e,  are  from 
 idLocalidad=83  OR with  idComunidadAutonoma = 15

 that query that i will made with a SELECT in SQL

 SELECT * FROM LOCALIDADES
 WHERE idLocalidad = 83 OR idComunidadAutonoma = 15

 ¿¿is it possible??

 i'm trying with a lot of things like

 Localidades/Localidad[idLocalidad = 83] |
 Localidades/Localidad[idComunidadAutonoma = 15];

 but it returns 3 elements (1 for idLocalidad = 83, and two for
 idComunidadAutonoma, when i really would like to receive 2...

 thanks in advance
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com