Foros del Web » Programando para Internet » PHP »

Parse error: syntax error, unexpected '"', expecting ')'

Estas en el tema de Parse error: syntax error, unexpected '"', expecting ')' en el foro de PHP en Foros del Web. me da este error theme joomla ayuda por favor. Parse error: syntax error, unexpected '"', expecting ')' in /var/www/vhost/xxxxxxxxx.com/home/html/templates/yoo_nano/warp/helpers/dom.php on line 534 y este es ...
  #1 (permalink)  
Antiguo 14/05/2011, 06:56
 
Fecha de Ingreso: marzo-2011
Mensajes: 6
Antigüedad: 13 años, 1 mes
Puntos: 0
Parse error: syntax error, unexpected '"', expecting ')'

me da este error theme joomla ayuda por favor.

Parse error: syntax error, unexpected '"', expecting ')' in /var/www/vhost/xxxxxxxxx.com/home/html/templates/yoo_nano/warp/helpers/dom.php on line 534


y este es el codigo que me da fallo

protected static $xpath = array('id' => "@id = '%s'", 'class' => "contains(concat(' ', normalize-space(@class), ' '), ' %s ')", 'attr' => "@%s", 'contains' => "contains(string(.), '%s')", 'not' => 'not(%s)', 'operators' => array("=" => "@%1 = '%3'", "!=" => "not(@%1) or @%1 != '%3'", "^=" => "starts-with(@%1, '%3')", "$=" => "substring(@%1, (string-length(@%1) - string-length('%3') + 1)) = '%3'", "*=" => "contains(@%1, '%3')", "~=" => "contains(concat(' ', normalize-space(@%1), ' '), ' %3 ')", "|=" => "@%1 = '%3' or starts-with(@%1, '%3-')"), 'pseudos' => array('first-child' => 'not(preceding-sibling::*)', 'last-child' => 'not(following-sibling::*)', 'only-child' => 'not(preceding-sibling::* or following-sibling::*)', 'enabled' => "not(@disabled) and (@type!='hidden')", 'disabled' => "(@disabled) and (@type!='hidden')", 'first' => 'position() = 1', 'last' => 'last()', 'empty' => 'count(*) = 0 and (count(text()) = 0)', 'checked' => '@checked'), 'combinators' => array('>' => 'child', '~' => 'general-sibling', '+' => 'adjacent-sibling'));


espero buestra ayuda GRACIASSSSS
  #2 (permalink)  
Antiguo 14/05/2011, 07:25
Avatar de Patriarka  
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 3 meses
Puntos: 288
Respuesta: Parse error: syntax error, unexpected '"', expecting ')'

y anda separando el codigo ordenadamente hasta encontrar el error de sintaxis
Código PHP:
Ver original
  1. protected static $xpath = array(
  2. 'id' => "@id = '%s'",
  3. 'class' => "contains(concat(' ', normalize-space(@class), ' '), ' %s ')",
  4. 'attr' => "@%s", 'contains' => "contains(string(.), '%s')",
  5. 'not' => 'not(%s)',
  6. 'operators' => array("=" => "@%1 = '%3'",
  7. "!=" => "not(@%1) or @%1 != '%3'",
  8. "^=" => "starts-with(@%1, '%3')",
  9. "$=" => "substring(@%1, (string-length(@%1) - string-length('%3') + 1)) = '%3'",
  10. "*=" => "contains(@%1, '%3')",
  11. "~=" => "contains(concat(' ', normalize-space(@%1), ' '), ' %3 ')",
  12. "|=" => "@%1 = '%3' or starts-with(@%1, '%3-')"),
  13. 'pseudos' => array('first-child' => 'not(preceding-sibling::*)', 'last-child' => 'not(following-sibling::*)', 'only-child' => 'not(preceding-sibling::* or following-sibling::*)', 'enabled' => "not(@disabled) and (@type!='hidden')", 'disabled' => "(@disabled) and (@type!='hidden')", 'first' => 'position() = 1', 'last' => 'last()', 'empty' => 'count(*) = 0 and (count(text()) = 0)', 'checked' => '@checked'), 'combinators' => array('>' => 'child', '~' => 'general-sibling', '+' => 'adjacent-sibling'));

algo asi
  #3 (permalink)  
Antiguo 14/05/2011, 11:43
 
Fecha de Ingreso: marzo-2011
Mensajes: 6
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Parse error: syntax error, unexpected '"', expecting ')'

Gracias por la ayuda esta es la linea que me da error.



"$=" => "substring(@%1, (string-length(@%1) - string-length('%3') + 1)) = '%3'",


alguna sugerencia del error

gracias
  #4 (permalink)  
Antiguo 14/05/2011, 12:09
Avatar de Patriarka  
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 3 meses
Puntos: 288
Respuesta: Parse error: syntax error, unexpected '"', expecting ')'

y bueno ya encontraste la linea de error,
ahora anda probando donde falta un )
donde es que sobra,

eso ya queda para vos, tenes que hacer tu propia experiencia,
no es mas que un ) mal puesto

o sino consulta en el manual substring

es lo mejor pàra que aprendas
  #5 (permalink)  
Antiguo 14/05/2011, 12:17
 
Fecha de Ingreso: marzo-2011
Mensajes: 6
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Parse error: syntax error, unexpected '"', expecting ')'

Cita:
Iniciado por grupoesmas Ver Mensaje
Gracias por la ayuda esta es la linea que me da error.



"$=" => "substring(@%1, (string-length(@%1) - string-length('%3') + 1)) = '%3'",


alguna sugerencia del error

gracias
Cita:
Iniciado por Patriarka Ver Mensaje
y bueno ya encontraste la linea de error,
ahora anda probando donde falta un )
donde es que sobra,

eso ya queda para vos, tenes que hacer tu propia experiencia,
no es mas que un ) mal puesto

o sino consulta en el manual substring

es lo mejor pàra que aprendas
Muchisimas gracias por tu ayuda amigo. un saludo
  #6 (permalink)  
Antiguo 14/05/2011, 12:18
Avatar de s00rk  
Fecha de Ingreso: octubre-2010
Ubicación: Mexico
Mensajes: 238
Antigüedad: 13 años, 6 meses
Puntos: 48
Respuesta: Parse error: syntax error, unexpected '"', expecting ')'

Bueno el codigo esta bien, ya que elimine

Código PHP:
protected 
y ya no me marco error. o.O

Quedandome asi(acomode el codigo):
Código PHP:
<?php
static $xpath = array(
'id' => "@id = '%s'"
'class' => "contains(concat(' ', normalize-space(@class), ' '), ' %s ')"
'attr' => "@%s"
'contains' => "contains(string(.), '%s')"
'not' => 'not(%s)'
'operators' => array("=" => "@%1 = '%3'"
"!=" => "not(@%1) or @%1 != '%3'"
"^=" => "starts-with(@%1, '%3')"
"$=" => "substring(@%1, (string-length(@%1) - string-length('%3') + 1)) = '%3'"
"*=" => "contains(@%1, '%3')"
"~=" => "contains(concat(' ', normalize-space(@%1), ' '), ' %3 ')"
"|=" => "@%1 = '%3' or starts-with(@%1, '%3-')"), 
'pseudos' => array('first-child' => 'not(preceding-sibling::*)'
'last-child' => 'not(following-sibling::*)'
'only-child' => 'not(preceding-sibling::* or following-sibling::*)'
'enabled' => "not(@disabled) and (@type!='hidden')"
'disabled' => "(@disabled) and (@type!='hidden')"
'first' => 'position() = 1'
'last' => 'last()'
'empty' => 'count(*) = 0 and (count(text()) = 0)'
'checked' => '@checked'), 
'combinators' => array('>' => 'child'
'~' => 'general-sibling'
'+' => 'adjacent-sibling'));
?>

Última edición por s00rk; 14/05/2011 a las 12:26
  #7 (permalink)  
Antiguo 14/05/2011, 12:40
 
Fecha de Ingreso: marzo-2011
Mensajes: 6
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Parse error: syntax error, unexpected '"', expecting ')'

Cita:
Iniciado por s00rk Ver Mensaje
Bueno el codigo esta bien, ya que elimine

Código PHP:
protected 
y ya no me marco error. o.O

Quedandome asi(acomode el codigo):
Código PHP:
<?php
static $xpath = array(
'id' => "@id = '%s'"
'class' => "contains(concat(' ', normalize-space(@class), ' '), ' %s ')"
'attr' => "@%s"
'contains' => "contains(string(.), '%s')"
'not' => 'not(%s)'
'operators' => array("=" => "@%1 = '%3'"
"!=" => "not(@%1) or @%1 != '%3'"
"^=" => "starts-with(@%1, '%3')"
"$=" => "substring(@%1, (string-length(@%1) - string-length('%3') + 1)) = '%3'"
"*=" => "contains(@%1, '%3')"
"~=" => "contains(concat(' ', normalize-space(@%1), ' '), ' %3 ')"
"|=" => "@%1 = '%3' or starts-with(@%1, '%3-')"), 
'pseudos' => array('first-child' => 'not(preceding-sibling::*)'
'last-child' => 'not(following-sibling::*)'
'only-child' => 'not(preceding-sibling::* or following-sibling::*)'
'enabled' => "not(@disabled) and (@type!='hidden')"
'disabled' => "(@disabled) and (@type!='hidden')"
'first' => 'position() = 1'
'last' => 'last()'
'empty' => 'count(*) = 0 and (count(text()) = 0)'
'checked' => '@checked'), 
'combinators' => array('>' => 'child'
'~' => 'general-sibling'
'+' => 'adjacent-sibling'));
?>

muchas gracias pero me sigue dando el mismo error es en esta linea exactamente donde esta el error.


"$=" => "substring(@%1, (string-length(@%1) - string-length('%3') + 1)) = '%3'",

Etiquetas: parse, syntax, unexpected
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:29.