XML to XHTML using XSL - Getting Element text

Discussion in 'XML' started by KDawg44, Jun 12, 2008.

  1. KDawg44

    KDawg44 Guest

    Hi,

    How can I use XSL to get to the text within an element?

    For example, say I have the following XML:

    <sunday>
    <am>Leisure Day</am>
    <pm>3:00 Tigers Game</pm>
    </sunday>

    how can I extract the word sunday?

    Thanks

    Kevin
     
    KDawg44, Jun 12, 2008
    #1
    1. Advertising

  2. * KDawg44 wrote in comp.text.xml:
    >How can I use XSL to get to the text within an element?
    >
    >For example, say I have the following XML:
    >
    > <sunday>
    > <am>Leisure Day</am>
    > <pm>3:00 Tigers Game</pm>
    > </sunday>
    >
    >how can I extract the word sunday?


    That's the element (type) name, check out the local-name(), name(), and
    namespace-uri() functions in the spec, <http://www.w3.org/TR/xpath>.
    --
    Björn Höhrmann · mailto: · http://bjoern.hoehrmann.de
    Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
    68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
     
    Bjoern Hoehrmann, Jun 12, 2008
    #2
    1. Advertising

  3. KDawg44

    KDawg44 Guest

    On Jun 11, 7:25 pm, Bjoern Hoehrmann <> wrote:
    > * KDawg44 wrote in comp.text.xml:
    >
    > >How can I use XSL to get to the text within an element?

    >
    > >For example, say I have the following XML:

    >
    > >       <sunday>
    > >            <am>Leisure Day</am>
    > >            <pm>3:00 Tigers Game</pm>
    > >    </sunday>

    >
    > >how can I extract the word sunday?

    >
    > That's the element (type) name, check out the local-name(), name(), and
    > namespace-uri() functions in the spec, <http://www.w3.org/TR/xpath>.
    > --
    > Björn Höhrmann · mailto: ·http://bjoern.hoehrmann.de
    > Weinh. Str. 22 · Telefon: +49(0)621/4309674 ·http://www.bjoernsworld.de
    > 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 ·http://www.websitedev.de/


    Thanks. name() did what i needed it to

    Thanks!

    Kevin
     
    KDawg44, Jun 12, 2008
    #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. Ray Tayek
    Replies:
    3
    Views:
    537
    Ray Tayek
    Nov 30, 2003
  2. Replies:
    1
    Views:
    3,690
    A. Bolmarcich
    May 27, 2005
  3. Replies:
    7
    Views:
    954
  4. HANM
    Replies:
    2
    Views:
    764
    Joseph Kesselman
    Jan 29, 2008
  5. Usha2009
    Replies:
    0
    Views:
    1,174
    Usha2009
    Dec 20, 2009
Loading...

Share This Page