I just dropped part of the code that I have now.
But is it not just a naming convention for attributes, attribute names
may not contain dots ???
Anyway I just go around for the time being by using underscore
replacement.
Have a nice day, Okido
<?php
// date 13-03-2009
load_tw(); // load the tiddly wiki from drive
$html = new DOMDocument;
$html->loadHTML($tiddler_area);
$tidlers = $html->getElementsByTagName("div");
foreach( $tidlers as $tidlers ) // traverse trough the <div> that are
the tiddlers
{
$body = $tidlers->nodeValue;
$title = $tidlers->getAttribute('title'); // title
$modifier = $tidlers->getAttribute('modifier');
$created = $tidlers->getAttribute('created');
$modified = $tidlers->getAttribute('modified');
$tags = $tidlers->getAttribute('tags');
$changecount = $tidlers->getAttribute('changecount');
}
//more code here
function load_tw() // load tw
{
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
$filename = 'whatever.html'; $sitename = 'tw2drupal';
global $tiddler_area;
$fp = fopen("$DOCUMENT_ROOT/$sitename/$filename", 'rb');
$startpos = "<div id=\"storeArea\">"; $endpos = "<!--POST-STOREAREA--
>";
$begin = strpos($tw_file,$startpos); //begin tiddler area
$end = strpos($tw_file,$endpos)-5; // end tiddler area -5 for the last
<div>
$tiddler_area = substr($tw_file,$begin,$end-$begin); // take out the
tiddler area
$tiddler_area = str_replace($startpos,"",$tiddler_area); // remove
start tiddler area
$tiddler_area = str_replace($endpos,"",$tiddler_area); // remove end
tiddler area
$tiddler_area = str_replace("*","--",$tiddler_area);
// replacing the dot in the atributes
$tiddler_area = str_replace("tsnip.category","tsnip_category",
$tiddler_area);
$tiddler_area = str_replace
("server.page.revision","server_page_revision",$tiddler_area);
$tiddler_area = str_replace("tsnip.url","tsnip_url",$tiddler_area);
}
?>
On Mar 12, 4:13 pm, FND <[email protected]> wrote:
> > Escaping the dot does not work
>
> Could you supply an example (ideally a minimal test case)?
> Perhaps we could figure something out...
>
> -- F.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---