-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
SPL have been aorund for a while now, and it is a great tool for a php
programmer. However, can anyone point me towards more detailed
php-documentation about how to use the SPL Classes?
I can only find http://www.php.net/~helly/php/ext/spl which is
I did a typo in the threads post.
The dtd is:
!ELEMENT Document ANY
!ELEMENT CMAES_Model_DbSection ANY
!ATTLIST CMAES_Model_DbSection S_iSectionId ID #IMPLIED
but it gives the warning when DomDocument::validate() is called:
Warning: Syntax of value for attribute S_iSectionId of
I totally missed that explanation on w3c.
Thanxs, now it works
/Erik
Rob wrote:
Erik Franzén wrote:
I did a typo in the threads post.
The dtd is:
!ELEMENT Document ANY
!ELEMENT CMAES_Model_DbSection ANY
!ATTLIST CMAES_Model_DbSection S_iSectionId ID #IMPLIED
but it gives the warning when
,
!DOCTYPE document SYSTEM document.dtd
Erik Franzén wrote:
The code below lacks the part where the folling DTD attribute is
created: !ATTLIST document id ID #IMPLIED
How can I create the above DTD attribute in the code below?
?php
// Creates an instance of the DOMImplementation class
$oDomImp
My real problem is that I am building a XML tree and I want to use the
getElementbyId method on the tree directly.
It would be very nice if it is possible to do it without including a
external dtd, since it takes some time to load every time.
The page
Have tried the following code:
?php
// Creates an instance of the DOMImplementation class
$oDomImp = new DOMImplementation;
// Creates a DOMDocumentType instance
$oDomDtd = $oDomImp-createDocumentType('Document', '',
'D:/CMAES/Src/dbtree.dtd');
// Creates a DOMDocument instance
$oDom =
Sorry, I copied the wrong DTD into the post.
The DTD is the following:
!ELEMENT Document ANY
!ELEMENT CMAES_Model_DbSection ANY
!ATTLIST CMAES_Model_DbSection S_iSectionId ID #IMPLIED
Here is the code example and result again:
?php
// Creates an instance of the DOMImplementation class
The code below lacks the part where the folling DTD attribute is
created: !ATTLIST document id ID #IMPLIED
How can I create the above DTD attribute in the code below?
?php
// Creates an instance of the DOMImplementation class
$oDomImp = new DOMImplementation;
// Creates a DOMDocumentType
According to the php docs, the method DomDocument-getElementById() will
not work unless the document is validated using a DTD (not schema):
According to the DOM standard this requires a DTD which defines the
attribute ID to be of type ID. You need to validate your document with
I have run into this behavior on several sites:
$dom-validate('books.dtd');
But according to the docs, the method it is defined
class DOMDocument {
bool validate ( void )
}
Is the dtd (file?) parameter deprecated?
/Erik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
I have run into this behavior on several sites:
$dom-validate('books.dtd');
But according to the docs, the method it is defined
class DOMDocument {
bool validate ( void )
}
Is the dtd (file?) parameter deprecated?
/Erik
Just tested, $dom-validate('books.dtd') generates the warning
I have the following class
class CMAES_DomIterator implements RecursiveIteratorIterator
{
}
When I am instanciating the class I am getting the following error:
Fatal error: CMAES_DomIterator cannot implement
RecursiveIteratorIterator - it is not an interface ...
Does not PHP 5.0.5
Of course you are right. I was fooled by this page:
http://www.wiki.cc/php/RecursiveIterator
?php
class RecursiveArrayIterator extends ArrayIterator implements
RecursiveIteratorIterator
{
function hasChildren()
{
return is_array($this-current());
}
function
Can anuyone describe this error?
Compile Error: E:\Source\CMAES\src\include\dom.inc.php line 67 -
Declaration of CMAES_DOM_Node_List::item() must be compatible with that
of CMAES_DOM_Node_List_Interface::item()
// {{{ interface CMAES_DOM_Node_List
/**
*
* @access public
*/
interface
stdclass;
$b = $a;
$c = $a;
?
unsetting a will only kill a, b and c will still be alive.
setting a to null will kill c but not b
/Erik
Torsten Roehr wrote:
Erik franzén [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Can anuyone describe this error?
Compile Error: E:\Source\CMAES\src
Is it possible to determine if a property inside a object is public,
protected or private in PHP 5?
/Erik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
See the following example:
?PHP
$oObjectA = array();
$oObjectB = array();
for(i=0;i10;i++) {
$oObjectA[$i] = new foo();
$oObjectB[$i] = $oObjectA[$i];
}
?
How do I remove an element in the oObjectA array without destroying the
object? I do not want to clone any object.
If I call
I am correcting myself...
?PHP
class foo {}
$oObjectA = array();
$oObjectB = array();
for($i=0;$i2;$i++) {
$oObjectA[$i] = new foo();
$oObjectB[$i] = $oObjectA[$i];
}
unset($oObjectA[1]);
var_dump($oObjectA);
var_dump($oObjectB);
?
will output:
array(1) {
[0]=
object(foo)#1 (0) {
}
}
$oObjectB[$i] = $oObjectA[$i];
The above statement does not matter, because in PHP5 objects are
referenced by handle, and not by value.
Look at this example:
?PHP
class foo {}
$a = new foo();
$b = $a;
unset($a);
var_dump($b);
?
This will output:
object(foo)#1 (0) {
}
The object is not destroyed!?
Thanxs for the help Curt!! Thats a tricky solution, but it works...
This is almost motivating a new method in PHP5: $foo-__destroy() which
will destroy the object once and for all... :)
/Erik
Curt Zirzow wrote:
* Thus wrote Erik Franzn:
$oObjectB[$i] = $oObjectA[$i];
The above statement does not
The docs for PHP5 and dom xml is not written yet, so I tried to find
information about load and save methods on the w3c site, but I didn't
find anything.
What's is the PHP5 eqvivalent to domxml_open_mem in PHP4?
/Erik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Say the you are going to create a simple forum and you want to have a number
of classes:
Class Sql - handles the DB interface
Class User - handles users
Class Messages - handles messages
When you are writing the code, you first creates a new sql object in order
to read or write data from or to
) private
members?
Erik FranzéN [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
After I posted the first message, I read something about PHP 5 at
www.zend.com and suspected that is was about the new Zend Engine.
I must have missed it totally! I was
I believed that PHP V4.3 should include the Zend engine version 2 since
there was two alpha releases for PHP-4.3.0 with Zend engine version 2
-PHP-4.3.0-dev-zend2-win32-alpha1
-PHP-4.3.0-dev-zend2-win32-alpha2
I'm waiting for Zend engine version 2. Where could I read information about
future
longing for it... :)
Rasmus Lerdorf [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
That was never the plan. It is scheduled for PHP 5 sometime in the next
6-12 months.
-Rasmus
On Tue, 24 Dec 2002, Erik Franzén wrote:
I believed that PHP V4.
25 matches
Mail list logo