473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Coursework - HTML Tags and Attributes to Uppercase

i'm so glad i found this forum! i have to have some coursework done by the end of the week and i really need it explaining to me. i'm not really that big on stuff like this but it's a part of my web design course. i've found everything else pretty easy and enjoyable until i got baffled by perl.

anyway here's the task

"Create a Perl scirpt which converts HTML tags into uppercase for a given file. When run, the scirpt should prompt the user to enter the name of the HTML file. This name should be verified to ensure the file extension is either .html or .htm (upper or lowercase is acceptable) and if not an error message should be displayed and the user prompted to re-enter the name.

On input of a validated file name, the file should be processed (if it exists) and all lowercase tages, e.g. <html>, converted into uppercase, e.g. <HTML>. You should not convert and other text and should also avoid converting tag attribute values, e.g.
<img src="picture.jpeg">
should be converted to:
<IMG SRC="picture.jpeg">
rather than:
<IMG SRC"PICTURE.JPEG">

At the end of the processing, the original file should be renamed with the .old extension, instead of .htm/.html, and the processed file given the original file name."


if anyone could help me with any part of this i'd be very grateful. i don't want to outright cheat, i would actually like to understand what i'm doing.
where should i start? are my teachers asking too much of a beginner like me? i think they are!
Aug 27 '07 #1
7 1898
KevinADC
4,059 Expert 2GB
You will want to use a regular expression to convert the tag names from lower to upper case. Lets see what code you have written so far.
Aug 27 '07 #2
Hi,
I think this is not too much difficult.. What u need to do is just

Converts all characters in the string to upper case.

uc Str

Takes a string and retruns it with the first character in upper case.

ucfirst Str1

Try this... and try to read String Functions.....
Aug 28 '07 #3
i don't have anything written up to now. looks like i'm going to miss my deadline aswell. i have absolutley no idea where to start. this is like asking my mother to fix my car.
Aug 28 '07 #4
KevinADC
4,059 Expert 2GB
No idea at all how to start? Is there no course material or teacher? If not, then what is the point of taking the course?
Aug 28 '07 #5
KevinADC
4,059 Expert 2GB
ganthimathi,

we like people to show effort before posting solutions especially to their class/course work.

-Kevin
Aug 29 '07 #6
numberwhun
3,509 Expert Mod 2GB
Unless of course your the person paying for their coursework and need to ensure that they pass.

Regards,

Jeff
Aug 29 '07 #7
miller
1,089 Expert 1GB
The Coursework Posting Guidelines explicitly prohibit giving solutions to homework. You must attempt the assignment/program yourself first, and only post questions regarding any difficulties you have with specific parts that you have trouble implementing.

In this case, I suggest that you disect the problem into it's constituent parts and work on those. Can you get input from the command line? Can you validate that a file exists and is of type html? Do you know how to prompt for new input?

There are plenty of steps to this problem, but all of them are achievable by someone who puts the work into it.

Once you are ready, post a new question in this thread.

- MODERATOR
Aug 29 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Maxim Vexler | last post by:
Hello to everyone, Assuming i have this simple script : <?PHP //Opening tag =' $html_header=' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"...
5
by: Donald Firesmith | last post by:
Are html tags allowed within meta tags? Specifically, if I have html tags within a <definition> tag within XML, can I use the definition as the content within the <meta content="description> tag? ...
4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
0
by: Agoston Bejo | last post by:
Tools / Options / Text Editor / HTML/XML / Format / Capitalization Usually I use Tags: Uppercase; Attributes: Uppercase but now I edit XML pages and I set them both to "As entered". However,...
9
by: Patient Guy | last post by:
Taking the BODY element as an example, all of its style attributes ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01, a fact noted in the DOM Level 2 HTML specification. ...
0
by: panik | last post by:
Hi, retreiving the source code from an instance of the AxWebBrowser component, using getBody(), through an IHTMLDocument2 object, makes the sourcode look very bad: All tags are in uppercase,...
1
by: Randall Parker | last post by:
I'm wondering if there are general rules for the use of HTML attributes with ASP tags? For example, one can set an id for an asp:DataGrid and it will show up as the id for the resulting HTML...
4
by: Arthur Dent | last post by:
Hello all, ive been programming with ASP.NET since it came out, but am just getting my feet with now with v.2. Ive noticed something strange in the way my HTML tables get rendered with 2. I use...
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.