I currently have code that generates XML code for all of the contacts within my Oracle array. I have tried to use the built in XML methods within PHP, but it did not give me the amount of control I need to get the right schema. Thus far, I have been running the PHP file which echoes all the XML code to a webpage and then selecting all within the page, pasting it to a blank Notepad file and saving it as XML. This works perfectly for now, but essentially I would like to be able to run the PHP file and end up with a saved XML file with a dynamic naming convention (writing_request_yyyymmddtttt.xml). Is there any way to easily accomplish this to make the process more automated? Here is a snippet of the code:
echo htmlspecialchars('<contact contactID="'.$row["UNIQUE ID"].'" action="AddOrModify">')."<br>".
htmlspecialchars('<contactField name="LastName">'.$row["LAST NAME"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="FirstName">'.$row["FIRST NAME"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="MiddleName">'.$row["MIDDLE INITIAL"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="Country">'.$row["COUNTRY"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="Code">'.$row["CODE"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="CustomField" customName="'.$row["CUSTOM LABEL 1"].'">'.$row["CUSTOM VALUE 1"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="CustomField" customName="'.$row["CUSTOM LABEL 2"].'">'.$row["CUSTOM VALUE 2"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="CustomField" customName="'.$row["CUSTOM LABEL 3"].'">'.$row["CUSTOM VALUE 3"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="CustomField" customName="'.$row["CUSTOM LABEL 4"].'">'.$row["CUSTOM VALUE 4"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="CustomField" customName="'.$row["CUSTOM LABEL 5"].'">'.$row["CUSTOM VALUE 5"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="CustomField" customName="'.$row["CUSTOM LABEL 6"].'">'.$row["CUSTOM VALUE 6"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="CustomField" customName="'.$row["CUSTOM LABEL 7"].'">'.$row["CUSTOM VALUE 7"].'</contactField>')."<br>".
htmlspecialchars('<contactField name="CustomField" customName="'.$row["CUSTOM LABEL 8"].'">'.$row["CUSTOM VALUE 8"].'</contactField>')."<br><br>".
htmlspecialchars('<contactPointList>')."<br>".
htmlspecialchars('<contactPoint type="Voice">')."<br>".
htmlspecialchars('<contactPointField name="Label">'.$row["PHONE LABEL 1"].'</contactPointField>')."<br>".
htmlspecialchars('<contactPointField name="CountryCode">'.$row["PHONE 1 COUNTRY CODE"].'</contactPointField>')."<br>".
htmlspecialchars('<contactPointField name="Number">'.$row["PHONE 1"].'</contactPointField>')."<br>".
htmlspecialchars('<contactPointField name="Extension">'.$row["PHONE EXTENSION 1"].'</contactPointField>')."<br>".
htmlspecialchars('</contactPoint>')."<br><br>".
htmlspecialchars('<contactPoint type="Voice">')."<br>".
htmlspecialchars('<contactPointField name="Label">'.$row["PHONE 2 LABEL"].'</contactPointField>')."<br>".
htmlspecialchars('<contactPointField name="CountryCode">'.$row["PHONE 2 COUNTRY CODE"].'</contactPointField>')."<br>".
htmlspecialchars('<contactPointField name="Number">'.$row["PHONE 2"].'</contactPointField>')."<br>".
htmlspecialchars('<contactPointField name="Extension">'.$row["PHONE EXTENSION 2"].'</contactPointField>')."<br>".
htmlspecialchars('</contactPoint>')."<br><br>".
htmlspecialchars('<contactPoint type="Email">')."<br>".
htmlspecialchars('<contactPointField name="Label">'.$row["EMAIL LABEL 1"].'</contactPointField>')."<br>".
htmlspecialchars('<contactPointField name="Address">'.$row["EMAIL 1"].'</contactPointField>')."<br>".
htmlspecialchars('</contactPoint>')."<br><br>".
htmlspecialchars('</contactPointList>')."<br><br>".
htmlspecialchars('</contact>')."<br><br>";
This is being run within the oci_fetch_array loop that also validates all the data. Anyone got any ideas?