473,320 Members | 1,858 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,320 software developers and data experts.

Unix C Program To Validate HTML Tags

i need to write a unix c program to open a given file and see if the nesting is fine,
assuming that all the tags in the html string are correctly formed,
that is when an angle bracket is seen,
assuming that it is followed by the remainder of a complete tag.

help me out!!
Jan 24 '08 #1
5 2984
gpraghuram
1,275 Expert 1GB
i need to write a unix c program to open a given file and see if the nesting is fine,
assuming that all the tags in the html string are correctly formed,
that is when an angle bracket is seen,
assuming that it is followed by the remainder of a complete tag.

help me out!!

Whats ur requirement?
You want to validate html files or a c file?
If it is only HTML then your approach is right but have u started working on this

Raghuram
Jan 24 '08 #2
sicarie
4,677 Expert Mod 4TB
Okay, so I'd start with being able to open the file - can you do that?
Jan 24 '08 #3
yup..i need to evaluate d html file..

m abl 2 read from a file..
my prob is in pushing the html tag onto the stack..
In start tag, once i find '<' i need to store the characters as a string till it reaches '>'..
so that i ll be able to match d string wth d end tag..
dono hw to extract it..:(
Jan 25 '08 #4
RRick
463 Expert 256MB
This is beginning to sound like an xml verifier. Html is notorious for supporting tags with no endings and other syntatically bad formats. I would not want to write one of these html verifiers.

Xml on the other hand demands that all nodes are closed, have the proper syntax, etc. etc. If this is what you want, there are lots of Xml readers and verifiers. Windows has one (?Xml Dom?) and there are plenty of free ones, too. Google for xml dom and xml verification.

This is a good place to look if you want to write your own.
Jan 25 '08 #5
gpraghuram
1,275 Expert 1GB
yup..i need to evaluate d html file..

m abl 2 read from a file..
my prob is in pushing the html tag onto the stack..
In start tag, once i find '<' i need to store the characters as a string till it reaches '>'..
so that i ll be able to match d string wth d end tag..
dono hw to extract it..:(

Are u aware of using Lex&Yacc.
This can help u to a larger extent of doing this.

Raghuram
Jan 25 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: francisl | last post by:
We have to build some script were I work to make a dynamic server inventory. But, the project team, a windows crew, start it all in vbscript and on mssql. Note, due to political reason, we can...
4
by: Tim Daneliuk | last post by:
OK, I've Googled for this and cannot seem to quite find what I need. So, I turn to the Gentle Geniuses here for help. Here is what I need to do from within a script: Given a username and a...
34
by: Volker Hetzer | last post by:
Hi! I've done lots of programming for CAD, which was basically C/C++ and tcl/tk. Now, we are thinking about introducing more web based tools, programming them ourselves and right now the toolchain...
5
by: Jim | last post by:
Can someone PLEASE tell me where I'm going wrong. I've stared at this page for 2 hours and still can't get it to validate on http://validator.w3.org/check. Page URL :...
1
by: MikeinDC | last post by:
I found some free js that I want to use in a class project. The original HTML used <form name="form1"> and the W3C validator I am required to use fails it. It says there is no attribute"name"....
26
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any...
1
by: anilareddy | last post by:
I have an application like this. I need to validate the start time in 2nd row against the start row in first row. I mean The start time value entered in the second row must not b the value entered in...
1
by: Andy Dingley | last post by:
On 31 Jul 2008 16:22:51 GMT, "mark4asp" <mark4asp@gmail.comwrote: It's hard to programatically validate HTML. You need to use Jade, because Mere Mortals don't get to go near the code that does...
1
Gulzor
by: Gulzor | last post by:
Hi, I have defined a set of custom tags that I put among regular HTML tags. E.g. <body> <div id="regular_id"> <namespace:container id="something" type="article" /> </div> </body>
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.