xpath question

Discussion in 'XML' started by Starton X. Mangrove, Jan 16, 2005.

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

    <description>this 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="description/*"/>

    ....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>this 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
     
    Starton X. Mangrove, Jan 16, 2005
    #1
    1. Advertising

  2. In article <OyjGd.44499$>,
    Starton X. Mangrove <> wrote:

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


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

    -- Richard
     
    Richard Tobin, Jan 16, 2005
    #2
    1. Advertising


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


    Thanks, that was it exactly.
     
    Starton X. Mangrove, Jan 16, 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. Marvin_123456

    "Memory leak" in javax.xml.xpath.XPath

    Marvin_123456, Jul 29, 2005, in forum: Java
    Replies:
    4
    Views:
    2,004
    jan V
    Jul 29, 2005
  2. Alastair Cameron
    Replies:
    1
    Views:
    7,476
    SQL Server Development Team [MSFT]
    Jul 8, 2003
  3. Anna
    Replies:
    0
    Views:
    553
  4. goog
    Replies:
    0
    Views:
    523
  5. Tjerk Wolterink

    XPath: efficiency in xpath expressions

    Tjerk Wolterink, Nov 13, 2004, in forum: XML
    Replies:
    1
    Views:
    1,677
    Richard Tobin
    Nov 13, 2004
Loading...

Share This Page