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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
twfurst
Forum Newbie
Posts: 2
Joined: Thu May 27, 2010 7:28 pm

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

Post 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
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

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

Post by internet-solution »

have you tried fopen() /fwrite () to write this information at the beginning of the file?
twfurst
Forum Newbie
Posts: 2
Joined: Thu May 27, 2010 7:28 pm

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

Post 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.
Post Reply