This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Monsieur, j'ai rencontre un problem avec template XSLT pour automatiquement generer des valeur dans lecas fichier XML: <A> Author 1</A> <A> Author 2</A> <A> Author 3</A> ............................avec A soit un balise au chemin Xpath /
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 12 Jun 2002 12:02:10 +0100
- Subject: RE: [xsl] Monsieur, j'ai rencontre un problem avec template XSLT pour automatiquement generer des valeur dans lecas fichier XML: <A> Author 1</A> <A> Author 2</A> <A> Author 3</A> ............................avec A soit un balise au chemin Xpath /
- Reply-to: xsl-list at lists dot mulberrytech dot com
> <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
> ','>',' ')"
> />
You have two problems:
(a) you are trying to manipulate XPath expressions as strings. There is
no way in standard XSLT to execute an XPath expression held as a string,
though you can do it using extensions such as saxon:evaluate().
(b) you are trying to manipulate XML documents as strings. There is no
way in standard XSLT to parse or serialize XML documents held as
strings, though you can do it with extensions such as saxon:parse() and
saxon:serialize() (new in Saxon 7.1).
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
- References:
- Monsieur, j'ai rencontre un problem avec template XSLT pour automatiquement generer des valeur dans lecas fichier XML: <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],... par exempledonc comme vous m'avez propose j'ai ecrit un template recursiveavec les parametre suivant: 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?Convert valeur String to XPath expression?