xpath question

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

    xpath question



    In my xml document I have a description element that contains varying xhtml,
    along the lines of

    <description>th is is a test</description>

    -or-

    <description><b >hello</b><br />this is a test<br /></description>


    When trying to select the description element in xpath...
    <xsl:copy-of select="descrip tion/*"/>

    ....Im getting uneven results. I would like get everything inside the
    description elements, but if I have no markup inside the description
    elements nothing is returned. If my description node is:
    <description>th is is a <b>test</b></description>

    then only "test" is returned. What is the correct way to get the varying
    stuff inside the description elements?

    thanks in advance





  • Richard Tobin

    #2
    Re: xpath question

    In article <OyjGd.44499$Yh 2.20379750@twis ter.nyc.rr.com> ,
    Starton X. Mangrove <desdfsdf_sdf39 3@yahoo.com> wrote:
    [color=blue]
    >When trying to select the description element in xpath...
    ><xsl:copy-of select="descrip tion/*"/>[/color]

    That selects the element children of description. If you want
    all the children, use description/node().

    -- Richard

    Comment

    • Starton X. Mangrove

      #3
      Re: xpath question



      [color=blue]
      > That selects the element children of description. If you want
      > all the children, use description/node().[/color]

      Thanks, that was it exactly.


      Comment

      Working...