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

RE: compare two unicode variables

Subject: RE: compare two unicode variables
From: hochen@xxxxxxxxxxx
Date: Thu, 12 May 2005 11:13:16 -0500
unicode xe1
Thanks for all your help. The problems are indeed related with Length. But it is
still puzzling. I tried the following code:

 <xsl:for-each select="Entry">
	     
<xsl:variable name="Wentry"><xsl:value-of select="ENTRY_FORM"/></xsl:variable>
      
 <xsl:variable name="Centry" select="substring($Wentry,1,1)"/>
 		
  <xsl:variable name="Kentry1" select="'&#x00E1;'"/>
         
           <xsl:if test="$Centry=$Kentry1">
          
       	    <option value="{position()+1}">
       	  
            <xsl:value-of select="$Wentry" />
            </option>   
   	   
	   </xsl:if>
            
  </xsl:for-each>

 I force the Kentry to be "&#x00E1;" and Entry_form to be Length 1. Then it
works. But when I put them here:
<xsl:for-each select="/reportname/Entry[substring(ENTRY_FORM,1,1) =
substring($Kentry,1,$wordLength)]">

It still doesn't work, so I don't know what happened. Even I gave value "xE1" to
Kentry, it still doesn't work.

Please help me again!

Thanks
Helen

Quoting Michael Kay <mike@xxxxxxxxxxxx>:

> >     
> > <!-- define the parameter -->
> > <xsl:param name="Kentry" />
> > <xsl:copy>
> >  <xsl:for-each 
> > select="/reportname/Entry[substring(ENTRY_FORM,1,$wordLength) =
> > 
> > Parameter "Kentry" could be "&#x00E1;"(unicode) and I do have 
> > a equal ENTRY_FORM
> > "&#x00E1;"in my xml file. 
> 
> I suspect that the value of $Kentry is a string of 8 characters (ampersand,
> hash, x, 0, 0, E, 1, semicolon) and the value of ENTRY_FORM starts with the
> single character whose Unicode code is xE1.
> 
> Numeric character references appearing in XML source files get converted to
> the relevant Unicode character by an XML parser. This parameter string
> hasn't been put through an XML parser.
> 
> Michael Kay
> http://www.saxonica.com/

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.