Home
TeamSite
Generating HTML with W3C Complaince
Sathi
Hi Everyone,
I am not able to Generate the HTML for my inputs with W3C Complaince using Site Publisher. So, Could you please post whether the issue can be resolved and also the steps for the same?
Regards,
Satish
Find more posts tagged with
Comments
Rick Poulin
You'll have to be more specific regarding what your specific validation errors are. I've successfully produced markup compliant with XHTML 1.0 Strict before, so any of the more shall we say 'flimsy' specs should be even easier.
I would pay special attention to how you're outputting content in your components. Obviously, if you capture a string like "Tom & Jerry"
in your datum and then <xsl:value-of select="/path/to/datum" disable-output-escaping="yes" /> then you're going to have validation problems.
Sathi
Thanks a lot!!
Actually, we use disable-output-escaping="yes" to indicate that special characters (like "<") should be output as is. How could we get the same functionality without using this in components?
Regards,
Satish
Rick Poulin
You have to make a decision at some point -- you can't have it both ways. If you assume that your users are smart enough to use '<' when they want a literal less-than sign, and use < when they want HTML markup, then you can't also assume that they'll break your markup by forgetting to escape ampersands or by writing other things that don't validate against the spec.
The way I see it, your choices are:
* use XSL's output escaping and tell your users they can't write markup
* use disable-output-escaping=yes and tell your users they might cause validation errors (or worse)
* use a custom pre-processor in workflow that parses your content and fixes it as needed [requires well-defined business rules understood by your users which are likely not to satisfy every possible case]
Obviously, you can save yourself a lot of dev and maintenance effort if you forget about option 3.