Subject: About genarate-id
Posted By: janedong Post Date: 11/14/2004 10:34:21 PM
The following is the snippet of my xsl code:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ross="http://www.rossinc.com/TOC.xsd" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes"/>

......

<xsl:template match="/">

......
    
<xsl:template match="ross:Menu">
    <table cellspacing="0" cellpadding="0">
        <xsl:attribute name="class">X</xsl:attribute>
        <xsl:attribute name="background"><xsl:value-of select="$ThemesPath" />GroupHeader.gif</xsl:attribute>
        
<xsl:attribute name="id">grp<xsl:value-of select="substring-after(generate-id(.),'XSLTMen')" />

......

The problem is : in some computer , the string generated by "generate-id(.)" contains 'XSLTMen' , and some didn't contain .

Can anybody help me for this ? Thanks first!

Reply By: mhkay Reply Date: 11/14/2004 10:49:13 PM
The only things you can rely on about generate-id() are that the result is an ASCII string conforming to certain rules, and that the result is different for each distinct node. Apart from that, the returned value depends entirely on which XSLT processor you are using, and may even vary from one run to the next. You appear to be using it for a job that it wasn't designed for.

Michael Kay
http://www.saxonica.com/
Reply By: janedong Reply Date: 11/15/2004 2:02:56 AM
I see ! Thanks very much !


Go to topic 22083

Return to index page 716
Return to index page 715
Return to index page 714
Return to index page 713
Return to index page 712
Return to index page 711
Return to index page 710
Return to index page 709
Return to index page 708
Return to index page 707