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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:35:34+00:00 2026-05-26T03:35:34+00:00

this may well be a very basic question, but I haven’t been able to

  • 0

this may well be a very basic question, but I haven’t been able to find anything on here or after an hour checking via google. I have a form with a load of inputs on it and a search autocomplete that will call xml data for the selected record. I intend to use an XSLT to transform this XML data and reproduce the completed version of the form for that client. I am new to XSLT’s so I have been experimenting with smaller examples so far, however I cannot, even in this smaller set up, get the produced HTML to have it’s inputs populated by the data in the XML.

Xalan will produce the HTML so I think both the XML and XSLT are at least vaild. The example code for both is shown below. I am aware that there is redundant code, (on key ups etc) in the XSLT. It is just a remenant from the full form that I will hopefully be getting working once I can sort tis example out.

XML

<?xml version="1.0"?>
<!-- clienttest.xml -->
<?xml-stylesheet type="text/xsl" href="XSLTtest.xsl"?>
<clientdetails>
    <clientcode>
        <CL.CREF>testsubjectcode</CL.CREF>
    </clientcode>
    <clientname>
        <CL.NAME>testsubjectname</CL.NAME>
    </clientname>
    <clientaccount>
        <CL.ACCT>testsubjectaccount</CL.ACCT>
    </clientaccount>
</clientdetails>

XSLT

<?xml version="1.0"?>
<!-- greeting.xsl -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output method="html" indent="yes" omit-xml-declaration="no"
            encoding="UTF-8"
            doctype-public="-//W3C//DTD XHTML 1.1//EN"
            doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>

    <xsl:template match="/">
        <html>
            <head>
                <title>XSLT Trials</title>
            </head>
            <body>
                    <xsl:apply-templates select="clientdetails"/>
            </body>
        </html> 
    </xsl:template>             

    <xsl:template match="clientdetails">
        <form>
            <label for="clientcode">Client code:</label>     
            <input class="medium" name="clientcode" method="post" onkeyup="changed2()" type="text" id="clientcode" placeholder="New client's code">
                <xsl:value-of select="./clientcode/CL.CREF"/>
            </input>
            <br></br>
            <label for="clientname">Client name:</label>
            <input class="medium" name="clientname" method="post" onkeyup="changed()" type="text" id="clientname" placeholder="New client's name"> 
                <xsl:value-of select="./clientname/CL.NAME"/>
            </input>
            <br></br>
            <label for="secondaccountcode">Second account code:</label>
            <input class="medium" id="secondaccountcode" name="secondaccountcode" type="text"> 
                <xsl:value-of select="./clientaccount/CL.ACCT"/>
            </input>
        </form>
    </xsl:template>
</xsl:stylesheet>

If anyone can give me a hand that would be great. I think I’m quite close but I just can’t get it to behave atm. Thanks

  • 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-26T03:35:35+00:00Added an answer on May 26, 2026 at 3:35 am

    If I underdstand your question correctly – you need to fill dynamically value attribute of an input element.

    For this as value for your attributes you can use active value templates – xPath expression limited with curved brackets (“{” and “}”).
    Therefore your XSLT “clientdetails” template would be (see value attribute):

    <xsl:template match="clientdetails">
        <form>
            <label for="clientcode">Client code:</label>     
            <input class="medium" name="clientcode" method="post" onkeyup="changed2()" type="text" id="clientcode" placeholder="New client's code" value="{./clientcode/CL.CREF}">
            </input>
            <br></br>
            <label for="clientname">Client name:</label>
            <input class="medium" name="clientname" method="post" onkeyup="changed()" type="text" id="clientname" placeholder="New client's name" value="{./clientname/CL.NAME}"> 
            </input>
            <br></br>
            <label for="secondaccountcode">Second account code:</label>
            <input class="medium" id="secondaccountcode" name="secondaccountcode" type="text" value="{./clientaccount/CL.ACCT}"> 
            </input>
        </form>
    </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may seem like a very basic question, but its been in my head
This may be a very basic question. But I am finding it confusing with
I know this question may well be the silliest question you've heard today, but
Well, I'm learning Scala so this question may be too basic for most people.
This may seem like a basic/stupid/obviously-answered question, but I wanted to check: why use
This may well be simple, but I'm new to Drupal. The organization I work
This may seem like a daft question, but i was wondering about how to
Dear Friends good afternoon. My problem may be this is very basic one i.e.
I'm new to rails and heroku , and this may very well seem like
The answer to this may very well be no, as much searching has turned

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.