PHP XML Parse (specifically for Tomboy/Gnote parsing to display/edit/add on Web UI)

ErrorS

New Member
Am currently working on a new idea in order to get tomboy/gnote notes parsed via PHP and displayed on a web page in order to add/edit/view notes. With such a tool one could then possibly create an OwnCloud application therefore allowing for a complete solution with sincronization between all machines (with offline access) and include a Web UI. At a latter stage one could also develop an Android application.I am somewhat new to PHP and XML and am therefore asking for some help.Here is an example XML file:\[code\]<?xml version="1.0"?><note version="0.3" xmlns:link="http://beatniksoftware.com/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size" xmlns="http://beatniksoftware.com/tomboy"><title>TEST Note</title><text xml:space="preserve"><note-content version="0.1" xmlns:link="http://beatniksoftware.com/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">TEST NoteNormal text<size:huge>Huge text</size:huge><size:large>Large text</size:large><size:small>small text</size:small><bold>BOLD Text</bold><italic>Italic text</italic><strikethrough>Striked text</strikethrough><highlight>Highlight text</highlight><list><list-item dir="ltr">BulletA<list><list-item dir="ltr">A1</list-item><list-item dir="ltr">A2<list><list-item dir="ltr">A2.1<list><list-item dir="ltr">A2.1.1<list><list-item dir="ltr">A2.1.1.1<list><list-item dir="ltr">A2.1.1.1.1</list-item></list></list-item></list></list-item><list-item dir="ltr">A2.1.2</list-item></list></list-item><list-item dir="ltr">A2.2</list-item></list></list-item><list-item dir="ltr">A3</list-item></list></list-item><list-item dir="ltr">BulletB</list-item></list>Normal text with space beforeAnd again</note-content></text><last-change-date>2013-03-28T02:11:04.603700Z</last-change-date><last-metadata-change-date>2013-03-28T02:11:11.012211Z</last-metadata-change-date><create-date>2013-03-28T01:39:08.607520Z</create-date><cursor-position>124</cursor-position><selection-bound-position>124</selection-bound-position><width>496</width><height>458</height><x>0</x><y>0</y><tags><tag>system:notebook:test</tag></tags><open-on-startup>False</open-on-startup></note>\[/code\]Here is the code I currently have:\[code\]<?php$file = "example.note";$xmlFile = file_get_contents($file) or die('Cant open note'); $xml = simplexml_load_string($xmlFile);print_r($xml); ?>\[/code\]And here is the output:\[code\]SimpleXMLElement Object ( [@attributes] => Array ( [version] => 0.3 ) [title] => TEST Note [text] => SimpleXMLElement Object ( [note-content] => TEST Note Normal text Normal text with space before And again ) [last-change-date] => 2013-03-28T02:11:04.603700Z [last-metadata-change-date] => 2013-03-28T02:11:11.012211Z [create-date] => 2013-03-28T01:39:08.607520Z [cursor-position] => 124 [selection-bound-position] => 124 [width] => 496 [height] => 458 [x] => 0 [y] => 0 [tags] => SimpleXMLElement Object ( [tag] => system:notebook:test ) [open-on-startup] => False )\[/code\]As you can see the "note content" isn't being entirely gathered and so I am reaching out to PHP guru's. How can I get the entire XML parsed in order to be able to then display it in normal HTML?Thanks,
 
Back
Top