Page 1 of 1

Creating <!DOCTYPE and <!ENTITY at beginning of XML using PH

Posted: Thu May 27, 2010 7:30 pm
by twfurst
Hello,

I am in the process of writing many XML files (416) from info on a MySQL Db. I have been sucessful in everything except for getting the following at the beginning of the file:

Code: Select all

<!DOCTYPE dmodule [
<!NOTATION png PUBLIC "pngviewer.exe">
<!NOTATION jpg PUBLIC "jpgviewer.exe">
<!ENTITY  SYSTEM "./Illustrations/$filename.jpg" NDATA jpg>
]>
I have been using the DOMDocument functions within PHP to write the remainder of the file, with pretty good success. I am not sure how to get this information placed before the "root" element.

Any help would be greatly appreciated. I would post the complete PHP script that I have thus far, but it is 850 lines long, and at work.

Thanks

Re: Creating <!DOCTYPE and <!ENTITY at beginning of XML usin

Posted: Fri May 28, 2010 1:19 am
by internet-solution
have you tried fopen() /fwrite () to write this information at the beginning of the file?

Re: Creating <!DOCTYPE and <!ENTITY at beginning of XML usin

Posted: Fri May 28, 2010 8:38 am
by twfurst
Thank you. That worked great, with a little thought and work. I had not even thought to use those functions. I was so wrapped up in trying to find a way to use the DOM functions.

Thanks again.