how to pass variable to xu:append select statement?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to pass variable to xu:append select statement?

Tanya Gray (Oxford)
Hello,

I would to pass a variable to an xu:append select statement. The variable is the value of an element in p:input #document-info. In the code below, the string that needs to be replaced by a variable is 'abcdef'.

Initially, I thought it would be possible to use <xsl:value-of select="//*/username"/> but found that the nested speech-marks cause a problem.

Does anyone know if it's possible to pass a variable to an append select statement?

thank you
Tanya

<!-- Dynamically build query -->
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#document-info"/>
        <p:input name="config">
            <xdb:update collection="/db/user-accounts"  xsl:version="2.0">
                <xu:modifications version="1.0">
                        <xu:append select="/Users/user/user-record[migs-user/username='abcdef']/user-activity/create-report">
                        <xsl:copy-of select="/document-info/document-id"/>  
                    </xu:append>
                </xu:modifications>
            </xdb:update>
        </p:input>
        <p:output name="data" id="query"/>
    </p:processor>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: how to pass variable to xu:append select statement?

Tanya Gray (Oxford)
Hello, just to say, I've answered my question:

<xu:append select="/abc/def/fg[hij={/doc/u/ment}]">

regards



>>> [hidden email] 10/21/05 4:17 PM >>>
Hello,

I would to pass a variable to an xu:append select statement. The variable is the value of an element in p:input #document-info. In the code below, the string that needs to be replaced by a variable is 'abcdef'.

Initially, I thought it would be possible to use <xsl:value-of select="//*/username"/> but found that the nested speech-marks cause a problem.

Does anyone know if it's possible to pass a variable to an append select statement?

thank you
Tanya

<!-- Dynamically build query -->
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#document-info"/>
        <p:input name="config">
            <xdb:update collection="/db/user-accounts"  xsl:version="2.0">
                <xu:modifications version="1.0">
                        <xu:append select="/Users/user/user-record[migs-user/username='abcdef']/user-activity/create-report">
                        <xsl:copy-of select="/document-info/document-id"/>  
                    </xu:append>
                </xu:modifications>
            </xdb:update>
        </p:input>
        <p:output name="data" id="query"/>
    </p:processor>





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: how to pass variable to xu:append select statement?

Erik Bruchez
Administrator
Tanya,

This is correct. This XSLT mechanism is called "attribute value templates":

   http://www.w3.org/TR/xslt#attribute-value-templates
   http://www.w3.org/TR/xslt20/#attribute-value-templates

This means that you create a "template" for an attribute value by using
"{" and "}" to specify the dynamic parts of the attribute, which are
interpreted as XPath expressions.

-Erik

Tanya Gray wrote:

> Hello, just to say, I've answered my question:
>
> <xu:append select="/abc/def/fg[hij={/doc/u/ment}]">
>
> regards
>
>
>
>
>>>>[hidden email] 10/21/05 4:17 PM >>>
>
> Hello,
>
> I would to pass a variable to an xu:append select statement. The variable is the value of an element in p:input #document-info. In the code below, the string that needs to be replaced by a variable is 'abcdef'.
>
> Initially, I thought it would be possible to use <xsl:value-of select="//*/username"/> but found that the nested speech-marks cause a problem.
>
> Does anyone know if it's possible to pass a variable to an append select statement?
>
> thank you
> Tanya
>
> <!-- Dynamically build query -->
>     <p:processor name="oxf:xslt">
>         <p:input name="data" href="#document-info"/>
>         <p:input name="config">
>             <xdb:update collection="/db/user-accounts"  xsl:version="2.0">
>                 <xu:modifications version="1.0">
>                         <xu:append select="/Users/user/user-record[migs-user/username='abcdef']/user-activity/create-report">
>                         <xsl:copy-of select="/document-info/document-id"/>  
>                     </xu:append>
>                 </xu:modifications>
>             </xdb:update>
>         </p:input>
>         <p:output name="data" id="query"/>
>     </p:processor>
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws