|
Posted by webrod on 04/30/07 07:41
Geoff,
you say: " can't see how you could possibly check the validity of the
code
without parsing the php".
That's the point. You *do not need* to parse the php to validate the
XHTML if you code properly.
You're examples are very good.
Let's have a look:
> <?php if($something_is_true){ ?>
> <div style='border:1px solid
> red;padding:20px;margin:20px;text-align:center'>
> <?php } ?>
I you read my other messages, a tool like tidy could say: "I don't
care about php code, so I update the text like this":
//REMOVED PHP TAGS
<div style='border:1px solid
red;padding:20px;margin:20px;text-align:center'>
//removed PHP TAGS
so I parse only:
<div style='border:1px solid
red;padding:20px;margin:20px;text-align:center'>
So where is the need to validate PHP code??
Anyway PHP code validation is done by a real development tool in the
very first step (like ZEND).
Again here:
<?php if($something_else_is_true){ ?>
<div style='border:1px solid
blue;padding:20px;margin:20px;text-align:center'>
some content
</div>
<?php } ?>
It could be updated like this by a tool like TIDY:
//REMOVED PHP TAGS
<div style='border:1px solid
blue;padding:20px;margin:20px;text-align:center'>
some content
</div>
//REMOVED PHP TAGS
so:
<div style='border:1px solid
blue;padding:20px;margin:20px;text-align:center'>
some content
</div>
etc etc
> OK, you may /never/ code like this. But that's not the point.
yes, you're right, this is out of scope, My apologies.
Rod
Navigation:
[Reply to this message]
|