Text Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rosemm

    Text Problem

    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.

  • Martin Honnen

    #2
    Re: Text Problem



    rosemm wrote:

    [color=blue]
    > 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.[/color]

    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

    Comment

    • Joris Gillis

      #3
      Re: Text Problem

      Tempore 17:20:37, die Thursday 13 January 2005 AD, hinc in foro {comp.text.xml} scripsit rosemm <rose.m@ghc.org >:
      [color=blue]
      > 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"[/color]

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


      --
      Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
      Vincit omnia simplicitas
      Keep it simple

      Comment

      Working...