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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:22:52+00:00 2026-05-25T06:22:52+00:00

I want to select all text and do a search and replace. I want

  • 0

I want to select all text and do a search and replace.
I want to turn all dashed into non-breaking dashes.

I am using this template for the search and replace part,
now I just need to run all text thru it..

  • 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-25T06:22:52+00:00Added an answer on May 25, 2026 at 6:22 am

    I don’t know what do you mean by “non-breaking dash”, but here is a simple solution:

    <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:param name="vRep" select="'&#8212;'"/>
    
     <xsl:template match="node()|@*">
      <xsl:copy>
       <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
     </xsl:template>
    
     <xsl:template match="text()">
      <xsl:value-of select="translate(.,'-', $vRep)"/>
     </xsl:template>
    </xsl:stylesheet>
    

    When this transformation is applied on any XML document, the result is the same document in which any '-' is replaced by whatever is specified as the value of the global parameter $vRep.

    For example, when applied on this XML document:

    <a>
     <b>Hi - hi</b>
     - - -
     <c>
       <d>Wow... - cool</d>
     </c>
     - - -
    </a>
    

    the result is:

    <a>
      <b>Hi — hi</b>
     — — —
     <c><d>Wow... — cool</d></c>
     — — —
    </a>
    

    Explanation: Use of the identity rule, overriden by a template matching any text node, and translating any '-' character in it to the character contained in $vRep — by using the standard XPath function translate().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably pretty simple. I want to select all elements of a given
I want to search for specific text in all procedures/functions etc. in all databases.
I have a search field, and using that single text box I want the
I have record in table like 'abc 100% text'. I want to search all
I want to select all categories from a webservice. The webservice does not have
I want to select all the children of the body element before element with
Suppose I have a column called fruits I want to select all of the
I have two table emptable1(empid,status) emptable2(empid,week) i want to select all the empid whose
Below is my stored procedure. I want use stored procedure select all row of
a want that, he found all select elements with id than begins with 'chbTypes'

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.