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 8908299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:08:34+00:00 2026-06-15T03:08:34+00:00

I have an XSLT(2.0) file; which takes an input XML data file and creates

  • 0

I have an XSLT(2.0) file; which takes an input XML data file and creates DDL/SQL Statements.
It works just fine. But it is a bit difficult to maintain, as it contains a lot of formatting information in ‘concat’ statements like this:

<xsl:value-of select="concat('CREATE USER ',$username,' IDENTIFIED BY ',$password,';',$nl)"/>

What I would prefer to do would be to encode my SQL Statements in a manner like this instead:

<some-enclosing-elements>[...]CREATE USER <username/>, identified by <password/>; [literally a newline here][...]</some-enclosing-elements>

I would perhaps keep this format above in the XML data file itself in a ‘lookup’ table at the top of the either the XSLT or the data document iself (I can’t work out which yet).

Is there a standard idiom that would allow this kind of templating ?
Any ideas ?

By the way; the data document contains many different users to create of course

  • 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-06-15T03:08:35+00:00Added an answer on June 15, 2026 at 3:08 am

    The AVT approach is just a little bit too devious for my taste. I tend to rely on the implicit concatenation done (in 2.0) by xsl:value-of:

    <xsl:value-of select="'CREATE USER', $username, 'identified by', $password"/>
    

    Another approach which I have used in applications where this kind of text templating is significant is to essentially write my own templating engine within XSLT; have a “message file” containing message templates in the form

    <message nr="1">CREATE USER <p:user/> IDENTIFIED BY <p:password/></message>
    

    and then write template rules to expand the messages by substituting the parameters.

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

Sidebar

Related Questions

I have a XML which works with an XSLT file that transforms the XML
I have an XML file which has to be transformed using XSLT, I am
I have an XSLT in which I create (from the input data) intermediary variables
I have a big (1.9 GB) XML file which has data I want to
I have an XSLT file for transforming data from table to INSERT statements. So
I have an xml file which I need to group-by using xsl:for-each-group. Everything works
I have an XML file with certain data which I have to convert it
All, I have an XML file which I transform it using an XSLT document
I have an XSLT stylesheet that transforms an XML file to JSON format and
I have an xslt file which I initially added to the Resources section of

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.