[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: generate an id

Subject: Re: generate an id
From: "Ali Choumane" <xml_tech@xxxxxxxxxxx>
Date: Tue, 12 Jul 2005 11:17:18 +0200
messenger.msn.click url.com
thank you, it was a very good idea, that works correctly now...

Ali,



From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  generate an id
Date: Tue, 12 Jul 2005 10:15:33 +0200

Hi Ali,

It looks to me as if you are using the template like a call-template and pass the actual data as parameters instead of using the current context node. Ever considered using match="*" mode="strSplit-to-word"?

Anyhow, I think you will be getting closer when you pass an argument to the generate-id() function, perhaps $arg1/*[1]? E.g. generate-id($arg1/*[1])..

Cheers,
Geert

Ali Choumane wrote:

This is the template which I call it to segment a text to "sentences" (special caracteres as delimetrs)

(I am modifing the module "strSplit-to-word.xsl" in fxsl library, to permit the split to sentence.)

<xsl:template match="str-split2words-func:*">
 <xsl:param name="arg1" select="/.."/>
 <xsl:param name="arg2"/>

 <xsl:copy-of select="$arg1/*[1]"/>
 <xsl:copy-of select="$arg1/sentence[position() != last()]"/>

<xsl:choose>
<xsl:when test="contains($arg1/*[1], $arg2)">
<xsl:if test="string($arg1/sentence[last()])">
<xsl:copy-of select="$arg1/sentence[last()]"/>
</xsl:if>
<sentence/>
</xsl:when>
<xsl:otherwise>
<sentence>
<xsl:attribute name="stamp">
<xsl:value-of select="generate-id()"/>
</xsl:attribute>
<xsl:attribute name="status">nonDisamb</xsl:attribute>
<original>
<xsl:attribute name="sourceLang">En</xsl:attribute>
<xsl:value-of select="concat($arg1/sentence[last()], $arg2)"/>
</original>
</sentence>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


Tx for your help

Ali,




From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  generate an id
Date: Mon, 11 Jul 2005 15:16:16 +0200

Hi,

Generate-id() function bases its id's on the current context node. You can supply an XPath as parameter to select another node to base the id on.

Can you supply a larger snippet of your XSL. At least the xsl-template in which you use the function?

Cheers,
Geert

Ali Choumane wrote:


Hi,


I am using the XPath function "generate-id()", obviously to give an xml id to some node in the target document as folowing:
...
<sentence>
<xsl:attribute name="stamp">
<xsl:value-of select="generate-id()"/>
</xsl:attribute>
...
</sentence>
...


But in the result, all the attribut "stamp" generated have the same value !!!
Can you help me?


Tx

Ali,

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/




-- Geert.Josten@xxxxxxxxxxx IT-consultant at Daidalos BV, Bleiswijk (NL)

http://www.daidalos.nl/
tel:+31-(0)10-850 12 00
fax:+31-(0)10-850 11 99

GPG: 1024D/12DEBB50


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




-- Geert.Josten@xxxxxxxxxxx IT-consultant at Daidalos BV, Bleiswijk (NL)

http://www.daidalos.nl/
tel:+31-(0)10-850 12 00
fax:+31-(0)10-850 11 99

GPG: 1024D/12DEBB50


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.