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

  • Home
  • SEARCH
  • 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 6324179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:39:20+00:00 2026-05-24T16:39:20+00:00

Can someone tell me why this is not working? Throughout my document I have

  • 0

Can someone tell me why this is not working?

Throughout my document I have several column breaks marked as follows: <cb ed="#S" n="45rb"/>
The hash tag is there to refer to another element where the source document is identified.

Now I want to display the column break in the following document. So that it looks like this:
|S45rb|. I thought I could use a simple substring function to get rid of the hash tag like so.

<xsl:template match="TU:cb">
    <xsl:variable name="hashms"><xsl:value-of select="//TU:cb/@ed"/></xsl:variable>
    <xsl:variable name="ms"><xsl:value-of select="substring($hashms,1,1)"/></xsl:variable>      

    <span>| <xsl:value-of select="$ms"/> <xsl:value-of select="//TU:cb/@n"/> |</span>
</xsl:template>

When I do it this way I get the following result: |#75ra|. Shouldn’t the first 1 in the argument refer to the first character of the string and then the second 1 tell it to move over one character and leave me with the desired S? Instead I don’t get the S but only the hash tag. Is there something about hash tags and strings I do not know?

Thanks for your help.

  • 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-05-24T16:39:20+00:00Added an answer on May 24, 2026 at 4:39 pm

    XSL is not 0 base, if you want to start at the second character (after the #), it should be 2 rather than 1.

    http://www.w3schools.com/Xpath/xpath_functions.asp

    substring($hashms,2,1) = S
    

    You can also omit the length, which might be of benefit for extensibility later on. Especially if whatever comes after the # is the identifier, why limit your code?

    substring($hashms,2) = S
    substring('#S2',2) = S2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone tell me why this is not working right? I have these lines
Can someone maybe tell me why this is not working? I have used echo
Can someone tell me why this is not working: <button class=btn danger id=delete onclick=return
Can someone take a look at this and tell me why it's not working.
Can someone tell me why is this happening? I have created a social networking
Can someone tell me where this structure language is from? I am not familiar
Can someone please tell me whats wrong with this code. I'm not getting complete
Can someone please tell me why this code will not work? It does compile.
Please can someone tell me why this isn't working before I defenestrate everything on
Can someone tell me why return false is not working? I just want to

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.