Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/03/2012, 13:22
Avatar de andresdzphp
andresdzphp
Colaborador
 
Fecha de Ingreso: julio-2011
Ubicación: $this->Colombia;
Mensajes: 2.749
Antigüedad: 12 años, 9 meses
Puntos: 793
Respuesta: Consulta de archivo XML

Ya intentaste así?

Código PHP:
Ver original
  1. <?php
  2.  
  3. $xml = '<ICE-interface xsi:noNamespaceSchemaLocation="http://xxxxxxxxxx/xsd/files.index.xsd">
  4.  <files.index Generated="2012335566">
  5.       <file path="/exports//ESP/468893.xml" Product_ID="468893" Updated="20120307013032" Quality="ICE" Supplier_id="1" Prod_ID="CB568331EE" Catid="377" On_Market="1" Model_Name=" CB568331EE " Product_View="7934094" HighPic="http://images.xxxxxxxx.xxx/img/norm/high/468893-HP.jpg" HighPicSize="35979" HighPicWidth="400" HighPicHeight="400">
  6.       </file>
  7.  </files.index>
  8. </ICE-interface>';
  9.  
  10. $sxe = new SimpleXMLElement($xml);
  11. echo $sxe->{'files.index'}->file['HighPic'];
  12. //http://images.xxxxxxxx.xxx/img/norm/high/468893-HP.jpg

o algo así?

Código PHP:
Ver original
  1. <?php
  2.  
  3. $xml = '<ICE-interface xsi:noNamespaceSchemaLocation="http://xxxxxxxxxx/xsd/files.index.xsd">
  4.  <files.index Generated="2012335566">
  5.       <file path="/exports//ESP/468893.xml" Product_ID="468893" Updated="20120307013032" Quality="ICE" Supplier_id="1" Prod_ID="CB568331EE" Catid="377" On_Market="1" Model_Name=" CB568331EE " Product_View="7934094" HighPic="http://images.xxxxxxxx.xxx/img/norm/high/468893-HP.jpg" HighPicSize="35979" HighPicWidth="400" HighPicHeight="400">
  6.       </file>
  7.  </files.index>
  8. </ICE-interface>';
  9.  
  10. $sxe = new SimpleXMLElement($xml);
  11.  
  12. foreach ($sxe->{'files.index'}->file->attributes() as $c => $v) {
  13.     echo "$c => $v <br />";
  14. }

Cita:
path => /exports//ESP/468893.xml
Product_ID => 468893
Updated => 20120307013032
Quality => ICE
Supplier_id => 1
Prod_ID => CB568331EE
Catid => 377
On_Market => 1
Model_Name => CB568331EE
Product_View => 7934094
HighPic => http://images.xxxxxxxx.xxx/img/norm/high/468893-HP.jpg
HighPicSize => 35979
HighPicWidth => 400
HighPicHeight => 400
__________________
Si sabemos como leer e interpretar el manual será mucho más fácil aprender PHP. En lugar de confiar en ejemplos o copiar y pegar - PHP