Text Problem

Discussion in 'XML' started by rosemm, Jan 13, 2005.

  1. rosemm

    rosemm Guest

    Hello everyone,

    I'm having a problem pulling the specific text that I want from an XML
    file.

    When we receive this file from it's source several of the fields have
    asterisks at the beginning. For what we need to do with the text we
    need the asterisks gone. For example, a name field might have "*Smith".
    What I need to produce in my text file is "Smith"

    I was hoping to do all the processing on my file with XSLT. Does XSLT
    have a function in which I can inspect text and manipulate it? If so
    what is it and where can I find more information on it.
    Thank you all for your help.
    rosemm, Jan 13, 2005
    #1
    1. Advertising

  2. rosemm wrote:


    > I was hoping to do all the processing on my file with XSLT. Does XSLT
    > have a function in which I can inspect text and manipulate it? If so
    > what is it and where can I find more information on it.


    XSLT 1.0 uses XPath 1.0 functions as documented here:
    <http://www.w3.org/TR/xpath#section-String-Functions>
    so starts-with and substring-after will probably solve what you are
    looking for.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jan 13, 2005
    #2
    1. Advertising

  3. rosemm

    Joris Gillis Guest

    Tempore 17:20:37, die Thursday 13 January 2005 AD, hinc in foro {comp.text.xml} scripsit rosemm <>:

    > When we receive this file from it's source several of the fields have
    > asterisks at the beginning. For what we need to do with the text we
    > need the asterisks gone. For example, a name field might have "*Smith".
    > What I need to produce in my text file is "Smith"


    For this specific problem,you could use the translate function of Xpath: <xsl:value-of select="translate(.,'*','')"/>


    --
    Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
    Vincit omnia simplicitas
    Keep it simple
    Joris Gillis, Jan 13, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kelvin
    Replies:
    2
    Views:
    567
    Andrew Balmos (abalmos)
    Nov 9, 2004
  2. Jim Owen
    Replies:
    1
    Views:
    433
    Natty Gur
    Jul 24, 2003
  3. =?Utf-8?B?Um9iZXJ0IEhhbHN0ZWFk?=

    Problem with text when inserting into text box

    =?Utf-8?B?Um9iZXJ0IEhhbHN0ZWFk?=, Apr 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    397
    Somchai U.
    Apr 27, 2004
  4. Kai Schlamp
    Replies:
    1
    Views:
    408
    Arne Vajhøj
    Mar 27, 2008
  5. leo
    Replies:
    1
    Views:
    260
    Bob Lehmann
    Dec 5, 2005
Loading...

Share This Page