You just can’t! Because you only communicate with SimpleXML by getter and setter methods. It’s possible there is another interface – anywsy i doubt it!
So, the magic of adding nodes is to convert from and to DOMDocument. The snippet below is just something stripped from sourcecode, so you get the idea how it works.
// This document is emtpy - it just illustrates an example! $this->xml = simple_xml_load(”);
// convert base document from simplexml to dom $dom = dom_import_simplexml($xml)->ownerDocument;
// get our nodes $newNode = dom_import_simplexml($this->character->xml); $oldNode = $dom->getElementsByTagName(‘character’)->item(0);
// import replacement node into our working DOM and reassign it $newNode = $dom->importNode($newNode,true);
// for example: replace the -element in our DOM $oldNode->parentNode->replaceChild($newNode, $oldNode);
// convert it back $this->xml = simplexml_import_dom($dom);
Endlich kann der Bürger sein virtuelles Hausrecht wieder etwas stärken. Nach der .htaccess zum BKA Terror-Bot, nun die .htaccess gegen den BND Terror-Kracken. Das hilft nur nix gegen Schäubles neue Schnüffelbehörde nach NSA Vorbild, aber seien wir wenigstens froh, dass unsere Bundeskanzlerin keine eigenen ihr unterstellten Geheimdienste á TALON & Co. hat - oder doch?.
Alle anderen Stellen sind ja gott-sei-dank von inkompetenten Pack und Internetausdruckern besetzt. Tja, da klappt es dann doch nicht so schnell mit dem Polizeistaat
# Deny access from BND Servers
# https://secure.wikileaks.org/wiki/T-Systems_BND_network_assignments%2C_13_Nov_2008
Order Allow,Deny
Deny from 195.243.248.226/32
Deny from 195.243.248.228/32
Deny from 62.156.187.234/32
Deny from 62.156.187.236/32
Deny from 62.159.60.150/32
Deny from 193.159.228.32/29
Deny from 193.159.238.168/29
Deny from 194.25.184.16/29
Deny from 194.25.42.232/29
Deny from 195.145.128.56/29
Deny from 195.145.163.64/26
Deny from 195.145.182.96/28
Deny from 195.145.182.96/28
Deny from 195.145.31.252/30
Deny from 195.145.57.176/28
Deny from 195.243.157.184/29
Deny from 195.243.248.224/29
Deny from 212.185.184.224/29
Deny from 212.185.191.128/29
Deny from 217.7.155.168/29
Deny from 217.89.74.208/28
Deny from 62.153.59.192/27
Deny from 62.153.65.32/29
Deny from 62.153.80.208/29
Deny from 62.153.87.0/28
Deny from 62.154.211.152/29
Deny from 62.154.226.64/26
Deny from 62.156.187.232/29
Deny from 62.157.136.64/27
Deny from 62.157.144.0/26
Deny from 62.157.193.128/26
Deny from 62.157.193.192/27
Deny from 62.157.194.32/29
Deny from 62.157.194.32/29
Deny from 62.159.19.208/29
Deny from 62.159.104.160/28
Deny from 62.159.209.144/29
Deny from 62.159.209.152/29
Deny from 62.159.21.152/29
Deny from 62.159.60.144/29
Deny from 62.159.63.72/29
Deny from 62.225.139.248/29
Deny from 62.225.74.128/29
Deny from 80.146.198.88/29
Deny from 62.159.104.160/28
Allow from all
How to calculate CIDR:
#!/usr/bin/perl use Net::CIDR; $range = shift; print(join("n", Net::CIDR::range2cidr("$range")) . "n");
This is credited to a text file by anonymous dated in 1998:
Any given rogram, once deployed, is already obsolete.
It is easier to change the specification to fit the program than vice versa.
If a program is useful, it will have to be changed.
If a program is useless, it will have to be documented.
Only ten percent of the code in
any given program will ever execute.
Software expands to consume all available resources.
Any non-trivial program contains at least one error.
The probability of a flawless demo is inversely proportional to the number of people watching, raised to the power of the amount of money involved.
Not until a program has been in production for at least six months will its most harmful error be discovered.
Undetectable errors are infinite in variety, in contrast to detectable errors, which by definition are limited.
The effort required to correct an error increases exponentially with time.
Program complexity grows until it exceeds the capabilities of the programmer who must maintain it.
Any code of your own that you haven’t looked at in months might as well have been written by someone else.
Inside every small program is a large program struggling to get out.
The sooner you start coding a program, the longer it will take.
A carelessly planned project takes three times longer to complete than expected; a carefully planned project takes only twice as long.
Adding programmers to a late project makes it later.
A program is never less than 90% complete, and never more than 95% complete.
If you automate a mess, you get an automated mess.
Build a program that even a fool can use, and only a fool will want to use it.
Users truly don’t know what they want in a program until they use it
…or how i always like to say: Programming is doing, coding is knowing. And sometimes, cryptic coding is knowing without doing or doing without knowing. But that depends on the language