and how bring priority up & down on tree ...
IMO
Sorry but i love xml / xslt my CMS http://slide.pulitzer.ch/title.html work only on xml....
mysql work only to search and to admin site....
And i like to bring admin all to qt ... i have enough with browser version xxx and javascripts version xxx to admin page...
if user like to bring moore priority to <subdir>(cat3) and move up how to swap this? from xml code down..?
QDomNode QDomNode::insertBefore ( const QDomNode & newChild, subcat1 )
or
$node->parentNode->replaceChild($frag,$node); ?? cat0,cat3
i see all dom function from php is same name as qt.... only DomXPath not exist and AppenddocumentFragment to node... i suppose QTextDocumentFragment is only a qtextedit QTextDocument class...
xml code...
<root>
<topdir name"qt">
<subdir name="libs1"/>
<subdir name="libs2"/>
<subdir name="libs3">
<subdir name="cat0">
<page name="qtstring"/>
</subdir>
<subdir name="cat3">
<page name="stringlist"/>
</subdir>
</subdir>
</topdir>
<topdir name="wx"/>
<subdir name="cat7">
<page name="wxstring"/>
</subdir>
</topdir>
</root>
<root>
<topdir name"qt">
<subdir name="libs1"/>
<subdir name="libs2"/>
<subdir name="libs3">
<subdir name="cat0">
<page name="qtstring"/>
</subdir>
<subdir name="cat3">
<page name="stringlist"/>
</subdir>
</subdir>
</topdir>
<topdir name="wx"/>
<subdir name="cat7">
<page name="wxstring"/>
</subdir>
</topdir>
</root>
To copy to clipboard, switch view to plain text mode
php5 code
///////////////////////// replace strong to b //////////////////////
$dom->loadHTML($xhtml);
$xp = new DomXPath($dom);
$resulta = $xp->query("//strong");
foreach ($resulta as $node) {
$internal=$node->nodeValue;
$frag = $dom->createElement("b",$internal);
$node->parentNode->replaceChild($frag,$node);
}
///////////////////////// replace strong to b //////////////////////
class XML extends DOMDocument {
function appendXML_or_File($node,$frag) {
if (is_file($frag)) {
$frag = @file_get_contents($frag);
}
$tmpdoc = new self('1.0', 'utf-8');
$tmpdoc->loadXML("<dummyroot>".$this->Remove_Version($frag)."</dummyroot>") or Error_Manager::msg('Error on fragment not possibel to insert xml Fragment!'.htmlentities($frag, ENT_QUOTES),__FILE__,__LINE__);
$newnode = $node->ownerDocument->importNode($tmpdoc->documentElement,true);
$child = $newnode->firstChild;
while ($child) {
$nextChild = $child->nextSibling;
$node->appendChild($child);
$child = $nextChild;
}
}
///////////////////////// replace strong to b //////////////////////
$dom->loadHTML($xhtml);
$xp = new DomXPath($dom);
$resulta = $xp->query("//strong");
foreach ($resulta as $node) {
$internal=$node->nodeValue;
$frag = $dom->createElement("b",$internal);
$node->parentNode->replaceChild($frag,$node);
}
///////////////////////// replace strong to b //////////////////////
class XML extends DOMDocument {
function appendXML_or_File($node,$frag) {
if (is_file($frag)) {
$frag = @file_get_contents($frag);
}
$tmpdoc = new self('1.0', 'utf-8');
$tmpdoc->loadXML("<dummyroot>".$this->Remove_Version($frag)."</dummyroot>") or Error_Manager::msg('Error on fragment not possibel to insert xml Fragment!'.htmlentities($frag, ENT_QUOTES),__FILE__,__LINE__);
$newnode = $node->ownerDocument->importNode($tmpdoc->documentElement,true);
$child = $newnode->firstChild;
while ($child) {
$nextChild = $child->nextSibling;
$node->appendChild($child);
$child = $nextChild;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks