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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Valid XHTML but have warnings.

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
I'm re-writing my statement system, using a Template module to separate my code from my HTML and to enable correct W3C validation.

HOWEVER, although I get GREEN and says that it is valid, i do get warning...
Below is a list of the warning message(s) produced when validating your document.

Warning Line 8 column 36: character "<" is the first character of a delimiter but occurred as data.

is this OK ? the line is as follows
Code:
<script type="text/javascript" src="<tmpl_var ESCAPE=HTML NAME='url_to_domain'>/scripts/scriptname.js"></script>

am i good to go with valid HTML seperate from my PERL, that i can then apply CSS to, am i finally getting there?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
This doesn't look right to me:
Code:
<script type="text/javascript" [COLOR=blue]src="[COLOR=red]<tmpl_var ESCAPE=HTML NAME='url_to_domain'>[/color]/scripts/scriptname.js"[/color]></script>

If this is the XHTML produced as the output of your template system, it appears that it's failing to replace the variable [tt]<tmpl_var ESCAPE=html name='url_to_domain'>[/tt].

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
sorry, i must have not explained properly, but that line is in the TEMPLATE, i am validating the template, when i run my PERL it DOES replace correctly.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
in that case, don't validate the template. validate the output.

The template doesn't need to be valid XHTML, because the browser never sees it. It simply needs to be a valid input for your parser.

It's much more important to validate your output, to ensure that the template engine is replacing elements correctly, and escaping those that need to be escaped (such as [tt]>[/tt] to [tt]&gt;[/tt]).

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
i was planning on validating both template and output, just to make sure!



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
i was planning on validating both template and output, just to make sure!

an honest thought, but, imagine you wrote your template in php. then, it would look like a jarbled mess to an HTML parser. agreed, definitely generate the page using your browser, then do a view > source and validate it, or just use FireFox with the web developer toolbar and just hit Ctrl + Shift + H.

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
This is the exact reason I decided to steer clear of EmbPerl, apart from not being in a position to install it :)

I'm doing my best to keep serverside / client side / structure / layout / formating etc.. apart from each other.

so my PERL has just PERL, my HTML has just HTML (where possible, the closest I have found i can get is with a template module, so some tags in the HTML are unavoidable)

Ensuring all Javascript & CSS are in external files.

none of this inline hard coding, mixing languages, inline styles, botched javascript dotted about, etc...

a hack might seem easier and quicker at the time, but before you're finished you have a spaghetti of mish mashed code inter-weiving each other.

no concistancy, duplicate wasted code, difficult bugs to track, styles hidden in PERL coded HTML some where under a rock you can't find, cross browser incompatability, the list goes on.... NOT ANY MORE!!!!!!!

i've learnt to "JUST SAY NO", it's gona be a bitch untangling the mess i've already created that's for sure, but i'm hoping my application and users will benefit, and I would have expanded my skills, quality of work, and a greater feeling of a job well done!

oh dear how sad am I , getting excitment out of my code like this, i'm sure there's a word for that - oh yeah, the people at work call me it all the time "Computer GEEK" - lol

thanks for all your help so far.



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
I guess you would never write anything in ASP then, since it freely mixes HTML and VBScript. Personally, I don't see how you can possibly develop a robust web application without mixing HTML and server-side coding. When I was writing apps in perl (before EmbPerl) I wrote my own program something like EmbPerl that allowed me to imbed variables, loops, conditional html generation, etc. into a web page. The only alternative was to generate the entire page in my perl program, which was inefficient of my time and cumbersome at best.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Out of choice i've decided to use PERL, though I have written some ASP for part of the public facing website.

how on earth did you write your own EmbPerl and get the server to interpret it, you must be one clever lady.

i'm unsure why you think keeping code seperate is not robust, most advice i've had on tek-tips has been to NOT mix them up.

but I hear you on the last sentence, it's exatly where i'm at right now!

Regards,
1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top