473,508 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UAProf parsing with PHP (WAP)

Hello,

I want to parse a UAProfile XML file to know the capabilities of the
clients WAP cellular phone. Has anybody already written some PHP code
that does this?

Anyway, I haven't done anything with XML under PHP before and I have
some problems with the XML DOM parser of PHP. In particular I am not
able to access a specific node in the XML document that contains the
screen size, in pixels, of the device. Here is my test code, maybe
someone can show me the problem:

<?php

$xmlfile = "http://communication-market.siemens.de/UAProf/S55_05.xml";

$dom = domxml_open_file($xmlfile)
or die("Error while parsing the document");

$root = $dom->document_element();
// Any of these dumps should show a valid node...

var_dump($dom->get_element_by_id('HardwarePlatform'));

$ctx=xpath_new_context($dom);

$ctx->xpath_register_ns("rdf",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#");
$ctx->xpath_register_ns("prf",
"http://www.wapforum.org/profiles/UAPROF/ccppschema-20000405#");
$ctx->xpath_register_ns("rdfs",
"http://www.w3.org/2000/01/rdf-schema#");

var_dump($ctx->xpath_eval('/rdf:Description/prf:component/rdf:Description/prf:ScreenSize'));
var_dump($ctx->xpath_eval('/Description/component/Description/ScreenSize'));
var_dump($ctx->xpath_eval('/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:ScreenSize'));
var_dump($ctx->xpath_eval('/RDF/Description/component/Description/ScreenSize'));
?>

Thanks in advance,
Udo

--
To reply by e-mail, use following address:
udonews AT nova-sys.net
Jul 16 '05 #1
0 3606

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1997
by: Drizzt | last post by:
Hi all. I'm a somehow rusty on PHP, so maybe this is a dumb question... I'm playing a bit with WAP developing, and found a simple problem right at the beginning. All the WAP pages that the...
2
2000
by: Holger Kreißl | last post by:
Hi, i want to use php to create WAP files (XML). So I wrote a php script that gives back a WAP-XML-File. But is that possible or do I need a special server or filename for WAP-Files. I must...
2
5124
by: Philip Ronan | last post by:
Hi, I want to configure my home page to redirect clients using WAP or i-mode browsers. I'm sure this problem must have been tackled by lots of people already, but I couldn't find any decent...
2
1260
by: James T | last post by:
Hi, at the company I work for we need to hire in London a WAP ASP engineer to assist in ongoing product developments and maintenance of WML and SMS driven applications and reporting systems....
1
3256
by: billy | last post by:
i've created the following code based on the classes i've found in the wmi test console. it works however, both this code and in the wmi test console it appears i'm getting two rssi signals from...
3
6992
by: domtam | last post by:
Hi there. My goal is to add some script to my home page (which is NOT asp / aspx page, and it is not hosted in IIS) so that any request from mobile browser will be redirect to another page (a...
1
4147
by: David Williams | last post by:
Has the Schema of the Web.Config changed in Web App Projects? After converting my 2005 Web Site project to a 2005 WAP, and switching to IIS Web Server, I am getting a number of errors at run time...
0
6943
RedSon
by: RedSon | last post by:
Originally published on www.developer.com/ws/proto/article.php/1377381 Edited by RedSon Learning WML - WAP Basics By Steve Schafer June 26, 2002 What Is WAP?
6
1348
by: AG | last post by:
Thanks to help from this group I was able to use both VB and C# in a Website Project, so I understand about creating language subfolders under App_Code folder. However, I have another project...
0
7324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7042
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7495
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5052
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.