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 about 7 years ago by Tony Crockford
  • @Tony - Yes, I did. As I said, the software I'm using seems to be stripping it out. Ben about 7 years ago
  • is the software a secret? can't really help much - do you have to use that software? it sounds broken! Tony Crockford about 7 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 about 7 years ago
  • Why does anybody need to use this software? It looks awful. Nathan Duran about 7 years ago
  • @Nathan - Please keep your spam to yourself. If your not willing to help, then don't respond. Ben about 7 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 about 7 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 about 7 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 about 7 years ago
  • own script, not on script! Tony Crockford about 7 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 about 7 years ago
  • Sorry, 'Were' not 'Where' Ben about 7 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 about 7 years ago
-1
points

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

Answered about 7 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 about 7 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 about 7 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 about 7 years ago