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

  • SEARCH
  • Home
  • 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 3611402
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:52:18+00:00 2026-05-18T21:52:18+00:00

How could I inject a –stringparam (xsltproc) into the DOCTYPE of a XSL stylesheet?

  • 0

How could I inject a –stringparam (xsltproc) into the DOCTYPE of a XSL stylesheet? The –stringparam is specified from the command line.

I have several books in docbook5 format I want to process with the same customization layer, each book having an unique identifier, here “demo”, so I’m running something like

xsltproc –stringparam course.name demo …

for each book.

Obviously the parameter is not recognized as such, but as verbatim text, giving the error:

warning: failed to load external entity “http://edu.yet-another-project.com/course/$(course.name)/entities.ent”

Here it is how I’ve tried, which won’t work:

<?xml version='1.0'?>
<!DOCTYPE stylesheet [
<!ENTITY % myent SYSTEM "http://edu.yet-another-project.com/course/$(course.name)/entities.ent">
%myent;
]>
<xsl:stylesheet  
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        version="1.0">

<!-- the docbook template used -->
<xsl:import href="http://docbook.org/ns/docbook/xhtml/chunk.xsl"/>

<!-- processor parameters -->
<xsl:param name="html.stylesheet">default.css</xsl:param>
<xsl:param name="use.id.as.filename">1</xsl:param>
<xsl:param name="chunker.output.encoding">UTF-8</xsl:param>
<xsl:param name="chunker.output.indent">yes</xsl:param>
<xsl:param name="navig.graphics">1</xsl:param>
<xsl:param name="generate.revhistory.link">1</xsl:param>
<xsl:param name="admon.graphics">1</xsl:param>

<!-- here more stuff -->
</xsl:stylesheet>

Ideas?

  • 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-18T21:52:19+00:00Added an answer on May 18, 2026 at 9:52 pm

    From http://www.w3.org/TR/xslt#output

    <xsl:output
      method = "xml" | "html" | "text" | qname-but-not-ncname 
      version = nmtoken 
      encoding = string 
      omit-xml-declaration = "yes" | "no"
      standalone = "yes" | "no"
      doctype-public = string 
      doctype-system = string 
      cdata-section-elements = qnames 
      indent = "yes" | "no"
      media-type = string />
    

    So, when using XSLT 1.0 you can’t parameterize public nor system DOCTYPE strings.

    From http://www.w3.org/TR/xslt20/#element-result-document

    <xsl:result-document
      format? = { qname }
      href? = { uri-reference }
      validation? = "strict" | "lax" | "preserve" | "strip"
      type? = qname
      method? = { "xml" | "html" | "xhtml" | "text" |
      qname-but-not-ncname }
      byte-order-mark? = { "yes" | "no" }
      cdata-section-elements? = { qnames }
      doctype-public? = { string }
      doctype-system? = { string }
      encoding? = { string }
      escape-uri-attributes? = { "yes" | "no" }
      include-content-type? = { "yes" | "no" }
      indent? = { "yes" | "no" }
      media-type? = { string }
      normalization-form? = { "NFC" | "NFD" | "NFKC" | "NFKD" |
      "fully-normalized" | "none" | nmtoken }
      omit-xml-declaration? = { "yes" | "no" }
      standalone? = { "yes" | "no" | "omit" }
      undeclare-prefixes? = { "yes" | "no" }
      use-character-maps? = qnames
      output-version? = { nmtoken }>
      <!-- Content: sequence-constructor -->
    </xsl:result-document>
    

    In XSLT 2.0 you can use xsl:result-document instruction for that task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could i inject packets to Linux TCP stack without modifying the ethernet driver? Could
From this question here , I was writing an enum wrapper to have some
Question: Is there a way to use Ninject to inject dependencies into my MVC
Currently I am trying to inject a stateless EJB into a CDI managed controller
Is it at all possible to inject a request into IIS for a page,
I was wondering wether it is possible to inject a frame script into a
I'm using Javascript to inject some stylized HTML into another webpage (which has been
Is it a bad idea to inject data into an itemrenderer. The reason I
I have a hand-written jquery javascript which is extended from the latest version. It's
I'm trying to inject some ASM code into a Win32 program with C++. Is

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.