hello all
I have created a simple xml file address.php i.e 
<?php
        $xmlstr = <<<XML
        <?xml version="1.0" ?>
                <!DOCTYPE AddressBook[
                <!ELEMENT AddressBook (person)+ >
                <!ELEMENT person (group,name,organization, address,email)>
                <!ELEMENT group (#PCDATA)>
                <!ELEMENT name (#PCDATA)>
                <!ELEMENT organization (#PCDATA)>
                <!ELEMENT address (#PCDATA)>
                <!ELEMETN email (#PCDATA)> ]>


XML;


?>
and one simple form: -
<html>
        <head>
                <title>My Address Book</title>
        </head>
        <body>
                <form action="addNewElement.php" method="post">
                        <div>
                                Group:<input type="text" size="20"
name="group"><br>
                                Name&nbsp;:<input type="text" size="20"
name="name"><br>
                                organization:<input type="text" size="20"
name="organization"> <br>
                                addresss:<input type="text" size="20"
name="ation"><br>
                                Email Address:<input type="text" size="20"
name="email">
                        </div>
                        <input type="submit" value="Submit">


                </form>
        </body>
</html>
But it gives lot of error : -
Warning: SimpleXMLElement::__construct() [function.--construct]: Entity:
line 9: parser error : DOCTYPE improperly terminated in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]: <!ELEMETN
email (#PCDATA)> ]> in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]: ^ in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]: Entity:
line 9: parser error : Start tag expected, '<' not found in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]: <!ELEMETN
email (#PCDATA)> ]> in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Warning: SimpleXMLElement::__construct() [function.--construct]: ^ in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

Fatal error: Uncaught exception 'Exception' with message 'String could not
be parsed as XML' in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php:5
Stack trace: #0
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php(5):
SimpleXMLElement->__construct('?<?xml version=...') #1 {main} thrown in
/home/rakesh/public_html/Tutorials/XML_PHP/XML_PHP_BOOK/addNewElement.php on
line 5

please help me out..
onewaylife












Edward Kay wrote:
> 
> In that case you need to do some of your own research. Google is your
> friend.
> 
>> Hello Edward
>> Just i don't  now where to start.
>>
>>
>> Edward Kay wrote:
>> >
>> > Hello,
>> >
>> > You say that you are "unable to store the files in XML". Why is
>> this? Are
>> > you getting an error message or do you just not know where to start?
>> >
>> > Edward
>> >
>> >> Dear All
>> >>
>> >> I am novice in PHP & XML, while trying I am creating a small
>> application
>> >> i.e. Address Book.
>> >> In this I am using Apache2, PHP5 and XML no database is used.
>> I have FC5
>> >> machines. but I am unable to store the files in XML. If any one
>> >> share their
>> >> experience in this by providing Examples or tutorials etc...
>> >> So far I have found tutorial related to porting the information
>> >> of data from
>> >> MySQL to XML and then php with help of DOM.
>> >>
>> >> Thanks
>> >> onewaylife
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/PHP-and-XML-tf2692397.html#a7507917
>> >> Sent from the PHP - General mailing list archive at Nabble.com.
>> >>
>> >> --
>> >> PHP General Mailing List (http://www.php.net/)
>> >> To unsubscribe, visit: http://www.php.net/unsub.php
>> >>
>> >>
>> >>
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>> >
>>
>> --
>> View this message in context:
> http://www.nabble.com/PHP-and-XML-tf2692397.html#a7517770
> Sent from the PHP - General mailing list archive at Nabble.com.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
-- 
View this message in context: 
http://www.nabble.com/PHP-and-XML-tf2692397.html#a7555006
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to