Ben 11

Is it possible using PHP (I was thinking may the phpinfo file or a php.ini file) or an .htaccess file to set a doctype for an entire subdirectory?

Basically, in a nutshell, I'm using a software that uses XSL templates to output data to a set of HTML files. Modifying the xsl:output tag to include the doctype breaks the template and therefore, does not work. Just adding the doctype in the XSL file, breaks it as well.

I need the proper doctypes in place for my CSS to function properly, cross-browser. I realize that I could add the doctype to the HTML files after export but, I'm really striving to automate this process.

Any thoughts?

2 answers

1
point
This was chosen as the best answer

does your XSL template include this:

<xsl:output method="xml"
            indent="yes"
            omit-xml-declaration="yes"
            doctype-public = "-//W3C//DTD XHTML 1.0 Strict//EN"
            doctype-system = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
/>
Answered over 6 years ago by Tony Crockford
  • @Tony - Yes, I did. As I said, the software I'm using seems to be stripping it out. Ben over 6 years ago
  • is the software a secret? can't really help much - do you have to use that software? it sounds broken! Tony Crockford over 6 years ago
  • @Tony - ha, nope its not secret. I'm using Collectorz.com Comic Collector 4.5. So yeah, I need to use this software. If I copy exactly what you have and replace my existing xsl:output tag, the html files are created but, the doctype is missing Ben over 6 years ago
  • Why does anybody need to use this software? It looks awful. Nathan Duran over 6 years ago
  • @Nathan - Please keep your spam to yourself. If your not willing to help, then don't respond. Ben over 6 years ago
  • I suspect that it is the script that creates the html, within the software that is at fault, why not use your template and the xml file the software generates with a different transform script that would honour the xsl:output declaration? Tony Crockford over 6 years ago
  • @Tony - while I appreciate the continued help, that's not really an option for me. The template makes use of the info that I've entered into the software. Guess I'll just keep searching for an alternative method Ben over 6 years ago
  • When I looked at the software, it was clear that it created a set of files from which it then ran a script to create the html, I was suggesting you let it do that and then run your on script on the same set of files to create better html Tony Crockford over 6 years ago
  • own script, not on script! Tony Crockford over 6 years ago
  • @Tony - "it was clear that it created a set of files from which it then ran a script to create the html" - Really? I was unaware of this step in the process. Where you able to find any clues as to what script was creating the HTML? Ben over 6 years ago
  • Sorry, 'Were' not 'Where' Ben over 6 years ago
  • I looked through the application support pages on the web site. and found this: http://www.collectorz.com/comic/xsltemplates.php and this http://www.collectorz.com/comic/xsltutorial.php so if you look for the files, you could run your own transform script against them. Tony Crockford over 6 years ago
-1
points

PHP has an auto_prepend_file directive, but it obviously only applies to files which are parsed by PHP.

Answered over 6 years ago by Nathan Duran
  • @Nathan - Yeah I had looked into that but, as you said, that doesn't help me alot with HTML files. This seems like something that you should be able to do with an htaccess file but, I have not been able to find anything on it. Ben over 6 years ago
  • No, it actually does not seem like something you should be able to do with an htaccess file at all. You should probably focus on solving your XSL syntax problem instead, as I'm quite sure doctypes have been inserted successfully by others. Nathan Duran over 6 years ago
  • @Nathan - I realize that. I've seen it implemented before. However, the software I am using (that makes use of the XSL template) seems to be stripping out this syntax. Hence my search for an alternative. Ben over 6 years ago