Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8583467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:32:44+00:00 2026-06-11T21:32:44+00:00

I have an XSLT which takes a . delimted string and splits it into

  • 0

I have an XSLT which takes a . delimted string and splits it into two fields for a SQL statement:

<xsl:for-each select="tokenize(Path,'\.')">
  <xsl:choose>
    <xsl:when test="position() = 1 and position() = last()">SITE = '<xsl:value-of select="."/>' AND PATH = ''</xsl:when>
    <xsl:when test="position() = 1 and position() != last()">SITE = '<xsl:value-of select="."/>' </xsl:when>
    <xsl:when test="position() = 2 and position() = last()">AND PATH = '<xsl:value-of select="."/>' </xsl:when>
    <xsl:when test="position() = 2">AND PATH = '<xsl:value-of select="."/></xsl:when>
    <xsl:when test="position() > 2 and position() != last()">.<xsl:value-of select="."/></xsl:when>
    <xsl:when test="position() > 2 and position() = last()">.<xsl:value-of select="."/>' </xsl:when>                            
    <xsl:otherwise>zxyarglfaux</xsl:otherwise>
  </xsl:choose>                 
</xsl:for-each>

The results are as follows:

INPUT: North         OUTPUT: SITE = 'North' AND PATH = ''
INPUT: North.A       OUTPUT: SITE = 'North' AND PATH = 'A'
INPUT: North.A.B     OUTPUT: SITE = 'North' AND PATH = 'A.B'
INPUT: North.A.B.C   OUTPUT: SITE = 'North' AND PATH = 'A.B.C'

This works, but is very lengthy. Can anyone see a more efficient approach?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:32:45+00:00Added an answer on June 11, 2026 at 9:32 pm

    Do you really need to tokenize? Looks like you are just splitting on the FIRST period. In this case, you could just do…

    <xsl:text>Site = '</xsl:text>
    <xsl:value-of select="substring-before(Path,'.')"/>
    <xsl:text>' AND PATH = '</xsl:text>
    <xsl:value-of select="substring-after(Path,'.')"/>
    <xsl:text>'</xsl:text>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a XSLT which will split large xml file into multiple xml file
I have a big XSLT which I have to insert into a Clob column.
I have an XSLT script which I would like to number things sequentially each
I have one huge XML document. I have set of XSL representing each node
I have this XSLT: <xsl:strip-space elements=* /> <xsl:template match=math> <img class=math> <xsl:attribute name=src>http://latex.codecogs.com/gif.latex?<xsl:value-of select=text()
I have an xslt file which I initially added to the Resources section of
I have a bit of XSLT which is performing some magic on integer database
When testing with .. /xsl/sample rendering.xslt ..which is a simple rendering provided out of
I have an XSLT function which checks whether the sent parameter is in YYYYMMDD
Say you have an XSLT which is currently in use for a myriad of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.