Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3305080
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:07:47+00:00 2026-05-17T21:07:47+00:00

I have a bunch of XML files which I use to generate HTML pages.

  • 0

I have a bunch of XML files which I use to generate HTML pages. Those pages ultimately get marked up (by hand) with some <%= %> tags and made into Ruby .erb templates.

Is there a way to generate the special tags <?php ?> or <%= %> directly during the XSL transform?

I’ve tried using a <![CDATA[ ... ]]> block, but then the output generates with &lt; and &gt; instead of < and >.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:07:47+00:00Added an answer on May 17, 2026 at 9:07 pm
    Is there a way to generate the special tags <?php ?> or <%= %> directly during the XSL transform?
    

    <?php ?> is not a “special tag” — this is of a standard node type in the XPath data model — a processing instruction.

    there is also an XSLT instruction to create a PI:

    <xsl:processing-instruction>

    Finally, you can create text like “<%= %>” if you use the text output method:

    <xsl:output method="text"/>
    

    but in the text output method you loseany node — you should enter every output character as text.

    So, it is a little-bit more convenient to use the default xml output method and the (non-mandatory!) attribute disable-output-escaping="yes" if this is supported by your XSLT processor.

    Here is an example:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes"/>
    
     <xsl:template match="/">
       <xsl:processing-instruction name="php"/>
       <xsl:text disable-output-escaping="yes">
         &lt;% Hello World! %>
       </xsl:text>
     </xsl:template>
    </xsl:stylesheet>
    

    applying this transformation to any XML document (not used) produces:

    <?php?>
         <% Hello World! %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of XML files which are using prefixes but without the
I have a bunch of projects which declare some spring bean files. I would
I have a bunch of XML Files which I have parsed into discrete fields.I
I have a bunch of wav files and corresponding XML files which contain times.
I have a bunch of XML files I'm using for user interface and string
I have a bunch of xml files named content_[0-9] (content underscore followed by a
I have a bunch of XML files that are about 1-2 megabytes in size.
I have bunch of strings, some of which are fairly long, like so: movie.titles
We have bunch of Domain Entities which should be rendered to an html format,
I have a file which has xml like tags and a bunch of invalid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.