OK, it DOES work after all. Here's what was happening. Yesterday I did my testing by manually editing the HTML; all good. Today, I put this in my XSL, to update our script:
<xsl:processing-instruction name="php">
<xsl:text>include($_SERVER['DOCUMENT_ROOT']."/lib/findingaid_mobile.php"); </xsl:text>
</xsl:processing-instruction>
Since the output automatically includes the ? at the beginning of the PI (<$php...) I assumed it would automatically include the closing '?' at the end of the PI . It doesn't, so I ended up with this error in the resulting HTML:
<?php include($_SERVER['DOCUMENT_ROOT']."/lib/findingaid_mobile.php"); > (missing closing '?')
I change my style sheet to this, so I'm manually outputting that last '?' :
<xsl:processing-instruction name="php">
<xsl:text>include($_SERVER['DOCUMENT_ROOT']."/lib/findingaid_mobile.php"); ? </xsl:text>
</xsl:processing-instruction>
And now I get this, which is correct:
<?php include($_SERVER['DOCUMENT_ROOT']."/lib/findingaid_mobile.php"); ?>
And it works fine, just like it did yesterday (I knew I wasn't crazy...) What's weird though is that when I put the file on the server and do View Source, the processing instruction isn't there, or at least it isn't visible. If I save the file to my desktop, it isn't there either. But it clearly IS there, because it's working. Guess I need to read up on PIs.
Now I'll leave y'all alone for a while ;)
Michele
-----Original Message-----
From: Michele R Combs
Sent: Wednesday, September 07, 2011 9:46 AM
To: Encoded Archival Description List ([log in to unmask])
Cc: 'Terry Catapano'
Subject: processing instructions before/after the doctype - correction
For anyone who was following this discussion yesterday, I was only partly correct. The processing instruction
<?php include($_SERVER['DOCUMENT_ROOT']."/lib/findingaid_mobile.php");>
does work following the doctype -- but only when viewing the page locally. When I put it up on the server the page appears totally blank (I can't even View Source, that's blank as well).
Just didn't want to leave bad info out there ;)
Perhaps removing xsl:output and spitting out the doctype manually is the answer after all. Terry, can you send me that sample code again? I thought I saved it but now can't find it.
Michele
+++++++++++++++
Michele Combs.
Librarian for Manuscripts and Archives Processing.
Special Collections Research Center.
Syracuse University.
315-443-2081.
[log in to unmask]
|