Joel McConaughy wrote:

I want to create anchor tags in my form template that contain widget values like the following:

<a href="nextpage?id=/<ft:widget id='uid'/>/" />

This produces the following error:

The value of attribute "href" associated with an element type "a" must not contain the '<' character

indeed, the result of what you typed doesn't pass the xml wellformedness test

Is there a way to do this within the template itself of do I need to add an xslt transform and use <xsl:attribute>?


'fraid so.

here is what i recently did for showing a mail-address value as a mailto: -link

in the template: you add

<ft:widget id="email"><fi:styling type="email" /></ft:widget>

plus you provide your own field-styling xslt that
1/ inherits from the existing styling by importing

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:fi="http://apache.org/cocoon/forms/1.0#instance";
                exclude-result-prefixes="fi">

<xsl:import
href="context://samples/blocks/forms/resources/forms-advanced-field-styling.xsl" />



and 2/ provide custom styling for these email-output styles

  <!--
     | this adds a fi:styling type="email" to widgets of type output
     | it will produce a mailto: href around them
     -->
  <xsl:template match="fi:output[fi:styling/@type='email']">
    <a href="mailto:{./fi:value}";><xsl:value-of select="./fi:value"/></a>
  </xsl:template>


(notice: the above uses the {} shorthand notation over the more puristic <xsl:attribute> but it pretty much boils down to the same thing



HTH, -marc=

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to