XML and XPath

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • x@a.c

    XML and XPath

    Couple of quick questions regarding Java and XML

    Is it possible to parse XML from a string instead of from a file?

    Using javascript I could explicitly call a node using
    xmlNode.selectS ingleNode("/node1/node[@attribute='wha tever']");
    Are there such functions available with Jave?

    Cheers

    Xav


  • FISH

    #2
    Re: XML and XPath

    "x@a.c" <e@23.cooo> wrote in message news:<4046b7d1$ 0$5870$afc38c87 @news.optusnet. com.au>...[color=blue]
    > Couple of quick questions regarding Java and XML
    >
    > Is it possible to parse XML from a string instead of from a file?[/color]

    I believe InputStream is one of the accepted data sources. Check out the
    java.io Javadocs for options on how to wire strings up as input streams.

    [color=blue]
    > Using javascript I could explicitly call a node using
    > xmlNode.selectS ingleNode("/node1/node[@attribute='wha tever']");
    > Are there such functions available with Jave?[/color]

    Jaxen appears to be a popular XPath engine for Java (http://jaxen.org/),
    but I've not used it, so cannot comment on its quality or suitability.


    -FISH- ><>

    Comment

    • x@a.c

      #3
      Re: XML and XPath


      "FISH" <joeking@mersey mail.com> wrote in message[color=blue]
      >
      > Jaxen appears to be a popular XPath engine for Java (http://jaxen.org/),
      > but I've not used it, so cannot comment on its quality or suitability.[/color]

      Thanks for that, good stuff.

      Jaxen seems really good but I have only used it with simple stuff so far.
      I was surprised that these transformations aren't covered in the javax.xml
      or org.xml libraries though.

      Cheers

      Xav


      Comment

      Working...