Skip to content
Advertisement

How to get attribute value type (ss:Name) from xml element with php

I want to get attribut value type (ss:Name) from xml element with php. But it doesn’t work.

This is my xml file :

JavaScript

and my php source

JavaScript

Can you help my to get ss:Name value ?

Thanks

Advertisement

Answer

The prefix of your attribute ss is a namespace.

You can grab attributes for that namespace by requesting it as the argument for Attributes() like this:

$node->Attributes(‘urn:schemas-microsoft-com:office:spreadsheet’);

JavaScript

Example php:

JavaScript

outputs

Name: 097-097-024

also note that your top node is Worksheet not Worksheet->Workbook

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement