Bullet creation in xml using PHP

Reply

Join Date: Sep 2008
Posts: 3
Reputation: rahejapreeti is an unknown quantity at this point 
Solved Threads: 0
rahejapreeti rahejapreeti is offline Offline
Newbie Poster

Bullet creation in xml using PHP

 
0
  #1
Sep 9th, 2008
If anybody could let me know how to create a bullet in an xml file using php. This piece of knowledge will be highly appreciated.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 791
Reputation: darkagn has a spectacular aura about darkagn has a spectacular aura about darkagn has a spectacular aura about 
Solved Threads: 109
darkagn's Avatar
darkagn darkagn is offline Offline
Master Poster

Re: Bullet creation in xml using PHP

 
0
  #2
Sep 9th, 2008
Hi rahejapreeti and welcome to DaniWeb

By a bullet, do you mean an ordered list? Do you know how to do that in XML (without php)? If so, let me point you in the direction of the Simple XML documentation. Simple XML provides an easy-to-use XML manipulation for PHP.

Hope this helps,
darkagn
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 3
Reputation: rahejapreeti is an unknown quantity at this point 
Solved Threads: 0
rahejapreeti rahejapreeti is offline Offline
Newbie Poster

Re: Bullet creation in xml using PHP

 
0
  #3
Sep 10th, 2008
Thats correct, i need an ordered list only, prefixed by a bullet. yes, we can manually put a code (&#x2022 for bullet in an xml file but through php if i append the code as string with the node, it gets converted to (&#x2022 in the generated xml file and in the browser appears as (&#x2022 instead of a bullet. i am using DOMDocument class to generate XML . could you tell me how to delete this (amp from the code (&#x2022 in the newly generated xml file , may be by using simpleXML.

Thanks and Regards


Originally Posted by darkagn View Post
Hi rahejapreeti and welcome to DaniWeb

By a bullet, do you mean an ordered list? Do you know how to do that in XML (without php)? If so, let me point you in the direction of the Simple XML documentation. Simple XML provides an easy-to-use XML manipulation for PHP.

Hope this helps,
darkagn
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 3
Reputation: rahejapreeti is an unknown quantity at this point 
Solved Threads: 0
rahejapreeti rahejapreeti is offline Offline
Newbie Poster

Re: Bullet creation in xml using PHP

 
0
  #4
Sep 12th, 2008
Hey Everyone !

Found the solution for the problem.... firstly i stored the xml string generated using domobject->saveXML() to a variable say $str. used str_replace('amp;', '',$str) and stored the resulting string in a new variable say $newstr. And then used that string to write a file using the following code:

$result_xml = '../data/mainmenu.xml';
if(!file_exists($result_xml))
system("touch ".$result_xml);
$xmlfile_xml = fopen($result_xml,"w");
fwrite($xmlfile_xml,$newstr);
fclose($xmlfile_xml);

And the problem got solved.

Thanx
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC