[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] building of a variable which contains nodes
Hello, I would like to create a variable which contains nodes. The node comes from the newReferenceAuthentifiedPackageDescriptorFile file or the currentAuthentifiedPackageDescriptorFile file. If i use <xsl:if> element my code is like this : <xsl:if test="$buildingType='EXCEPTION_PROCEDURE' "> <xsl:variable name="ListOfServiceDescriptor" select="$currentAuthentifiedPackageDescriptorFile //Subset[normalize-space(@serviceName)!='' and .//SingleElement/@isVersionned='YES']"/> <xsl:call-template name="makeRootDescriptor"> <xsl:with-param name="listOfServiceDescriptor" select="$ListOfServiceDescriptor"/> </xsl:call-template> </xsl:if> <xsl:if test="$buildingType='STANDARD' "> <xsl:variable name="ListOfServiceDescriptor" select="$newReferenceAuthentifiedPackageDescriptorFile //Subset[contains($servicesDescriptor,@serviceName)]"/> <xsl:call-template name="makeRootDescriptor"> <xsl:with-param name="listOfServiceDescriptor" select="$ListOfServiceDescriptor"/> </xsl:call-template> </xsl:if> This program works fine, but I don't want to duplicate the call of the makeRootDescriptor template. I want to call this template once. So I'm trying to solve my problem by using <xsl:choose> element like this <xsl:variable name="ListOfServiceDescriptor"> <xsl:choose> <xsl:when test="$buildingType='EXCEPTION_PROCEDURE' "> <xsl:value-of select="$newReferenceAuthentifiedPackageDescriptorFile //Subset[contains($servicesDescriptor,@serviceName)]"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$currentAuthentifiedPackageDescriptorFile//Subset[normalize-space(@serviceName)!='' and .//SingleElement/@isVersionned='YES']"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:call-template name="makeRootDescriptor"> <xsl:with-param name="listOfServiceDescriptor" select="$ListOfServiceDescriptor"/> </xsl:call-template> But it doesn't work because <xsl:value-of> element returns a string value, so I got this message : XPATH: Can not convert #RTREEFRAG to a NodeList! Does there exist another approach ? Is the <xsl:if> element is the only solution ? Thanks for your help. Stéphane XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|