This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Catching head


Brian,

> How would I do a hidden field that the value equals the value of orgId when
> I have

Presumably by a hidden field you mean that you're creating an HTML
input element with type="hidden" and a value equal to the value of
the 'head' element's 'orgId' attribute?

How to get the value of the 'head' element's 'orgId' attribute depends
on where you start from.  If you start from the 'head' element, then
it's just:

  @orgId

If you start from the acctXML element, then it's:

  head/@orgId

If you start from the request within the acctXML Element, then it's:

  ../head/@orgId

If the acctXML element is the document element (the element that holds
the entire document) then wherever you start from then you can always
use:

  /acctXML/head/@orgId

and so on.

I'll assume that you're starting from the acctXML element.  To create
a hidden input field in your HTML, you need:

  <input type="hidden" name="orgId" value="..." />

The value is where you want to put the XPath that I've discussed
above.  To make the XSLT processor include the evaluated value,
include it as an attribute value template, within {}s:

  <input type="hidden" name="orgId" value="{head/@orgId}" />

You can do this in other ways, most notably:

  <input type="hidden" name="orgId">
    <xsl:attribute name="value">
      <xsl:value-of select="head/@orgId" />
    </xsl:attribute>
  </input>

This is useful if you want to do any kind of conditional processing on
the value of the attribute.

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]