XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Yvonne TanSubject: Variable as part of a tag?
Author: Yvonne Tan
Date: 31 May 2007 06:42 AM
Originally Posted: 31 May 2007 06:35 AM

I was just wondering if anyone knows how to retrieve a variable and display it as part of a tag name?
<Senior-staff-$variable> I want to create a tag starting with "senior"

my variable in Xquery returns a 'faculty' value..

Does anyone know the exact function I can use to code that tag in my Xquery? Thanks!

Here is my Xquery:
let $a :=doc("research.xml")/research,
$staff := $a/staff/row

for $fac in distinct-values($staff/faculty)

return <Senior-staff>{$fac}



Alberto MassariSubject: Variable as part of a tag?
Author: Alberto Massari
Date: 31 May 2007 07:56 AM
Hi Yvonne,
you need to use the element constructor

return element {concat("Senior-staff-",$variable)} {

Hope this helps,

Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.