[xquery-talk] optional attributes via function?

Per Bothner per at bothner.com
Tue Sep 28 20:08:56 PDT 2004


Dmitri.Colebatch at toyota.com.au wrote:

>
>   <widgetspecifications>
>   {
>     for $spec in $this//SPEC
>     return
>     <widgetspecification 
>       validFrom="myfn:transformDate($spec/VALIDFROM)" 
>       myfn:outputValidToIfRequired($spec/VALIDTO)>
>        ...
>     </widgetspecification>          
>   }
>   </widgetspecifications>

element widgetspecification {
   attribute validFrom myfn:transformDate($spec/VALIDFROM),
   myfn:outputValidToIfRequired($spec/VALIDTO),
   ...
}

-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/


More information about the talk mailing list