Re: [xsl] Variables

Subject: Re: [xsl] Variables
From: List Owner <xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Oct 2009 07:53:27 -0400
You will improve the chances that you will receive prompt and helpful responses on XSL-List by:

  - asking specific enough questions that answers are possible. Describe
    what you are trying to do, how you approached it, what happened, and
    why you don't like the result you got

    In your case, select one question (you mention "several problems")
    and focus on it. Ask any other questions separately.

  - supplying small samples of files that illustrate your question or
    problem. For example, an XML file, an XSLT stylesheet, the result
    you got, and the result you want - all in miniature (and remembering
    that everything posted to XSL-List is archived in public)

    Create the smallest possible XML document and smallest possible
    XSLT that shows how you are trying to create the hyperlink. Leave
    out anything that is not related to this small issue.

  - describing the topic of your question concisely in the subject line
    Good subject lines - those that describe the subject matter of your
    message - not only increase the chances that you will receive answers
    to questions or responses to comments, they also make your message
    and any replies to it accessible in the list archives.

    In this case, you might want to describe your question as:
    "Concatenate two element values as an attribute value".

Instructions on subscribing to XSL-List are available at
and the XSL-List archives are at

-- Tommie

Hi all ,
I' m a complete newbie in xml/xsl , and I'm having several problems .
I have the following xml :

<webinfo workingdir="x_10_2009" />
<protocol name="xplor" type="pm">
<parameter init_t="2500" high_step="10000" cool_step="10000"
end_count="5" loop_count="3" timestep="0.005" n_thread="20" />
<cls name="tensor" scale="1000">
<cls name="noe" scale="50">
<xpcs xpcs_file="calbindin_PCS_ce.tbl" xclass="pcsce" t1="521.4" t2="-175.5" fmed="20" scale="5.0" />
<xpcs xpcs_file="calbindin_PCS_dy.tbl" xclass="pcsdy" t1="9041.9" t2="-5601.7" fmed="20" scale="0.25" />
<xpcs xpcs_file="calbindin_PCS_yb.tbl" xclass="pcsyb" t1="1978.7" t2="-923.3" fmed="20" scale="1.25" />
<xrdc xrdc_file="calbindin_RDC_ce.tbl" xclass="rdcce" t1="-0.424" t2="0.143" fmed="20" scale="1.0" />
<xrdc xrdc_file="calbindin_RDC_dy.tbl" xclass="rdcdy" t1="-7.348" t2="4.552" fmed="20" scale="0.05" />
<xrdc xrdc_file="calbindin_RDC_yb.tbl" xclass="rdcyb" t1="-1.608" t2="0.750" fmed="20" scale="0.25" />
<metal_parameter type="xml">
<convert type="xplor,amber" />
<type_name name="M1" element="Ca" mass="40.080" eps="0.05" />
<metal_topology type="xml">
<res name="XM1">
<atom_name name="CA2" type_name="M1" charge="2.0" num="1" />
<analysis comp_sel="name CA" top_frac="0.2" />
<output name="xplor">
<iteration number="1">
<pdb_info directory="./input_9/"
<XPCS_tensor A1="554.334203883598" energy_pcs="0.958539032156901"
A2="-166.871736148801" class="pcsce"
total_energy="89.1003471455398" />
<pdb_info directory="./input_9/"
<XPCS_tensor A1="541.035035882894" energy_pcs="1.39407060526426"
A2="-159.967740084884" class="pcsce"
total_energy="188.041801829022" />
<pdb_info directory="./input_9/"
<XPCS_tensor A1="535.219580534061" energy_pcs="1.32367130882385"
A2="-175.784774140119" class="pcsce"
total_energy="90.7929905009074" />

and the xsl ( which probably will be infested with errors :) ):

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="";>
<xsl:output method="html" encoding="UTF-8"/>

   <xsl:template match="/">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<!--<link xmlns=""; type="text/css" href="" />-->

<!--<link rel="stylesheet" type="text/css" media="print" href="css/enmrwebui.css" />-->
<!--<xsl:if test="@name='xplor'">-->
<xsl:if test="webenmr/calculation">
<xsl:if test="webinfo">
<xsl:value-of select="@workingdir"/>
<xsl:if test="webenmr/calculation/output/iteration">
<table id="outputTable">
<xsl:for-each select="webenmr/calculation/output/iteration">
<xsl:value-of select="@number"/>

<xsl:for-each select="pdb_info">
<td><a href="file_pdb/">
<xsl:value-of select="@filename"/>
<xsl:if test="XPCS_tensor">
<th>XPCS Tensor A1 </th><th>Energy PCS</th><th>A2</th><th>Class</th><th>Total Energy</th>
<xsl:for-each select="XPCS_tensor">
<td><xsl:value-of select="@A1"/> </td>
<td> <xsl:value-of select="@energy_pcs"/></td>
<td><xsl:value-of select="@A2"/> </td>
<td><xsl:value-of select="@class"/></td>
<td> <xsl:value-of select="@total_energy"/></td>
</tr> </xsl:for-each>

I want to concatenate the "workingdir" and "filename" values in an hyperlink , something like <a href='workingdir/filename'>File</a>
but atm nothing seems to work .
I'm sure it' s a silly thing , but I have already lost 2 days trying to achieve it , and I was wondering if someone could help me .
Many thx in advance .


P.S.: I hope you can understand my english ...


B. Tommie Usdin                        mailto:btusdin@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                           Phone: 301/315-9631
Suite 207                                    Direct Line: 301/315-9634
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in XML and SGML

Current Thread