2 Replies - 333 Views - Last Post: 08 August 2018 - 12:39 AM Rate Topic: -----

#1 winkimjr2   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 148
  • Joined: 30-May 12

How do I check the first 3 characters in an element?

Posted 07 August 2018 - 09:58 AM

I have the StatuteCode node below, I would like to check if the first 3 characters are not equal to 169.

<StatuteCode Word="169142a4">Running</StatuteCode>


How do I do it using xslt choose?

What I have tried.
<xsl:choose>
	<xsl:when test='(StatuteCode,1,4)="169")'>
		<xsl:value-of select="true()"/>
	</xsl:when>
	<xsl:otherwise>
		<xsl:value-of select="false()"/>
	</xsl:otherwise>
</xsl:choose>



I think is is wrong.

Is This A Good Question/Topic? 0
  • +

Replies To: How do I check the first 3 characters in an element?

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14856
  • View blog
  • Posts: 59,272
  • Joined: 12-June 08

Re: How do I check the first 3 characters in an element?

Posted 07 August 2018 - 10:03 AM

This isn't really VB.NET, or even .NET.

Moving to 'other languages'.
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw   User is online

  • Stealth IT
  • member icon

Reputation: 6737
  • View blog
  • Posts: 27,745
  • Joined: 12-December 12

Re: How do I check the first 3 characters in an element?

Posted 08 August 2018 - 12:39 AM

Why did you assume - guess - that (StatuteCode,1,4) would work? That is not a way to make progress.

On a quick search that appears to be a function called substring available.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1