473,659 Members | 2,526 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_fil e($xmlfile)
or die("Error while parsing the document");

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

var_dump($dom->get_element_by _id('HardwarePl atform'));

$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.or g/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 3616

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

Similar topics

4
2005
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 editor (WAPTor) generate begin with <?xml version="1.0"?> That, <? is also the PHP tag for the beginning of the PHP scripting... I've solved with this:
2
2014
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 use PHP because I want show some dynamic content.. Maybe somebody tried the same thing and can give me some hints. At the moment my cellphone shows "connection error" only... :-/
2
5135
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 material on the subject. This is what I'm using at the moment: = = = = = = = = = = = = = = = = = = = = = = = = = = = = = /* Redirect non-standard user agents */
2
1265
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. This will be achieved with database driven ASP and WML development and the use of existing management interfaces. You should have experience of SQL Server database design and as optimisation and data mining will be an integral part of this role
1
3268
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 the same wifi nic...the first has the "instancename" of the nic driver...the second is just a "?"...each have differing signal strengths. can someone explain? also, will there definitely always only be one "active" wifi nic at any given time? i...
3
6998
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 wap page which uses asp.net mobile control page). How can I do that? Originally, I planned to use Javascript to do it. <script language="javascript">
1
4150
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 in my web.config files starting with: Unrecognized attribute 'type'. This error occurs when parsing the web.config file where first highlighted below. I do not see the referenced type in the GAC (System.Configuration.ApplicationSettingsGroup),...
0
6957
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
1358
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 that I converted from Website Project to Web Application Project. It is all VB except for one C# class. Since there is no App_Code folder with WAP, is there any way to still include the C# class in the same project or am I resigned to either...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8539
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
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.