Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format XML in perl

Status
Not open for further replies.

929fireblade

Programmer
May 16, 2005
4
GB
Can anyone help with this.

Normally I will design my perl pages within normal HTML progs like Frontpage and Publisher to get the look right and then copy and paste the html into notepad, make the necessary adjustments to it to create dynamic results tables, change drop down menus etc etc. I then just save it as a .pl file.

Problem is I have upgraded to Publisher 2003 which includes XML. This doesn't just create html files but creates html files, a root folder and XML filelist etc.

To test it, I then just simply copied the html code from a document, pasted it in a text document and used a print qq around it. The page is fomatted completely wrong when it appears on the screen when you run the script. Boxes and pictures don't appear the text is in the wrong place etc.

I can put the script to run in the index_files folder, cgi-bin or wherever to try and get it to format completely but no matter where I run it from the page is still incorrectly formatted...

Can anyone tell me where I am going wrong?
 
Doesn't matter sussed it out now.

In case any of you get the same problem, I had to write a compare script to see the difference between the output html of the script and the original perl file.

The problem lies with how perl interprets the \ command...

IE as you know to display xyx@xyx.com, you have to write xyx\@xyx.com

Similarly all the lines of script that contain things like v\:* {behavior:url(#default#VML);}
are only displayed as
v:* {behavior:url(#default#VML);}
(without the \) in the browser window.

This was corrected easily by putting
v\\:* {behavior:url(#default#VML);}
instead.

Similarly all the variables that start with @ need the \ in front too. (\@ instead of @).

This is easily done with "find and replace" in a text doc, but a bit of a nightmare when you have about 50 scripts to do, so I am writing a simple script to put in the cgi-bin which will sort all the relevant scripts out automatically. I will provide a link too it later so you can all download it if you ever get the same problem (which you probably will).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top