[Home] [By Thread] [By Date] [Recent Entries]
I meet this problem when i try to write a template to extract automatique values in XML which have the chemin Xpath similars. for example: <A> Author 1</A> <A> Author 2</A> <A> Author 3</A> ............................ avec A soit un balise au chemin Xpath /html/body/table/tr/td[1],/html/body/table/tr/td[2],/html/body/table/tr/td[3],... So I have a template :
<xsl:choose> <xsl:when test="string-length($titi) = 0" /> <xsl:otherwise> <xsl:value-of select="$openning" disable-output-escaping="yes"/> <xsl:value-of select="$titi" disable-output-escaping="yes"/> <xsl:value-of select="$closing" disable-output-escaping="yes"/> <xsl:call-template name="GetAllAuthor"> <xsl:with-param name="path" select="$path" /> <xsl:with-param name="index" select="$index+1" /> <xsl:with-param name="openning" select="$openning" /> <xsl:with-param name="closing" select="$closing" /> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> and the file XSLT to test <xsl:template match="/"> <HTML> <BODY> <xsl:call-template name= "GetAllAuthor"> <xsl:with-param name="path" select="'/html/body/blockquote/div[1]/font/a'" /> <xsl:with-param name="index" select="1"/> <xsl:with-param name="openning" select="concat('<','c:Author','>',' ','<','c:Name','>',' ')" /> <xsl:with-param name="closing" select="concat('<','/','c:Name','>',' ','<','/','c:Author','>',' ')"/> </xsl:call-template> </BODY> </HTML> </xsl:template>sl:template> but the out put is not correct because the value of $path is Xpath expression and can not combine with a String? So if any one can help me? Thanks alot. Have a good day. path: Chemin XPath (ne contient pas la portion index): /html/body/table/tr/td index: nombre d'ordre de ce balise : 1,2,3,4,... Mais le problem est: le chemin Xpath n'est pas valeur String donc on ne peut pas "concat" : $path,'[',$index,']' pour creer un nouveau chemin XPath pour l'appel de template prochaine. Si on les transmet des valeurs string: on ne peut pas effectuer operations comme: <xsl value-of select = $path> pour extrait la valeur dans Web Page? Donc je ne sais pas on peut resoudre ce problem ? XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



