Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24
Like Tree1Likes

Thread: Specific attributes in XPath

  1. #21
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,931
    Rep Power
    19

    Default Re: Specific attributes in XPath

    "But the results are not I have expected."
    We're not mind readers.
    What did you expect, and what did you see?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  2. #22
    Fhernd is offline Member
    Join Date
    Oct 2011
    Location
    Bogotá Colombia
    Posts
    5
    Rep Power
    0

    Default Re: Specific attributes in XPath

    Sorry, Tolls. I have modified my original post.

    What I need to expect from that XPath expression (//yweather:forecast[1]/@*) are attribute values from

    Java Code:
    <yweather:forecast day="Tue" date="24 Apr 2012" low="9" high="17" text="Cloudy" code="26" />

    They are: Tue, 24 Apr 2012, 9, 17, Cloudy, and 26.


    So long.

  3. #23
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: Specific attributes in XPath

    Hm... your code is weirdly cut off on the right margin. Is anyone else seeing it that way?
    Get in the habit of using standard Java naming conventions!

  4. #24
    Fhernd is offline Member
    Join Date
    Oct 2011
    Location
    Bogotá Colombia
    Posts
    5
    Rep Power
    0

    Default Re: Specific attributes in XPath

    I have resolved that issue using NamespaceContext for XPath:

    Go to here: XPath issue in Java [Solved] (XML forum at JavaRanch)

    References:

    Using the Java language NamespaceContext object with XPath
    Last edited by Fhernd; 04-25-2012 at 01:31 AM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 2
    Last Post: 11-08-2008, 10:40 AM
  2. Xpath and Xquery
    By Peter in forum Advanced Java
    Replies: 1
    Last Post: 07-05-2007, 03:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •