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 7368409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:40:05+00:00 2026-05-29T03:40:05+00:00

<title> <article_title>Land a b c d Band</article_title> </title> using the following function replace(article_title, ‘(^[^

  • 0
<title>
 <article_title>Land a b   c   d      Band</article_title>
</title>

using the following function

replace(article_title, '(^[^ ]+)(.+\s+)([^ ]+)$', '$1 $3')

this string in is transformed to Land Band which is exactly what i want.

but the problem is i need this solution in xslt 1.0 since the java app that i am working with can only handle xslt 1.0 parsing.

  • 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-29T03:40:07+00:00Added an answer on May 29, 2026 at 3:40 am

    This XSLT 1.0 transformation (there is a nasty SO bug and the code isn’t indented — I apologize for this visual mess…):

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:template match="node()|@*">
      <xsl:copy>
       <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
     </xsl:template>
    
     <xsl:template match="text()" name="removeSingles">
       <xsl:param name="pText" select="."/>
    
       <xsl:variable name="vText" select="normalize-space($pText)"/>
    
       <xsl:if test="string-length($vText)">
        <xsl:variable name="vLeftChars" select=
        "substring-before(concat($vText, ' '), ' ')"/>
    
        <xsl:if test="string-length($vLeftChars) >1">
         <xsl:value-of select="$vLeftChars"/>
         <xsl:if test=
          "not(string-length($vLeftChars)
              >=
               string-length($vText)
               )
          ">
           <xsl:text> </xsl:text>
          </xsl:if>
        </xsl:if>
    
        <xsl:call-template name="removeSingles">
         <xsl:with-param name="pText" select=
         "substring-after($vText, ' ')"/>
        </xsl:call-template>
       </xsl:if>
     </xsl:template>
    </xsl:stylesheet>
    

    when applied on the provided XML document:

    <title>
     <article_title>Land a b   c   d      Band</article_title>
    </title>
    

    produces the wanted, correct result:

    <title>
       <article_title>Land Band</article_title>
    </title>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm storing a bunch of the following struct Article { std::string title; unsigned db_id;
I am using the following query to get the latest articles (article title +
I have following simple class: @interface Article: NSObject { NSString *title; } @property (copy,
Title is the entire question. Can someone give me a reason why this happens?
This query works: SELECT Article.id, Article.post_time, Article.post_locked, Article.comments_locked, Article.title, IF(CHAR_LENGTH(Article.content)>2000, RPAD(LEFT(Article.content,2000),2003,'.'), Article.content) as content,
I want to format the posts on a blog to have stacking 'title divs'
I have this method in a controller: def article_info if @article = Article.find_by_permalink(params[:permalink]) @title
I'm trying to code a page which has many articles. Each article's title is
I am having trouble with the following query which returns the following error: 'Article'
I have two tables, like this: #Articles: ID | Title 1 Article title 2

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.