XPath and DOM

Hi,
I am wondering how to incorporate support for XPath into my XML DOM app. Do I need to add another library or is support provided in any of the std Java API classes?
Thanks for help in advance,
Claire

Hello
Xalan, part of the XML apache project (xml.apache.org), offers a module with XPath support (org.apache.xpath). I'm not sure, if Xalan made it into the standard version of the JDK 1.4.
If you use a XML database, the XML:DB (www.xmldb.org) api also included XPath support as an optional module.
Mathias

Similar Messages

  • XPath and oracle parser

    Hi,
    I am using Oracle parser to parse my XML file, as i found that it is faster then IBM and sun parser, But i think it does not support XPath, so how can i use XPath and oracle parser, I can also use Sun parser , but dont know if it has XPath support,
    So please help me out

    I suppose it supports DOM or a saxHandler that can provides you a DOM
    tree. For Xpath, may I suggest you my solution : http://www.japisoft.com/jxpath
    Regards,
    A.brillant

  • Xpath and context objects

    hi expects,
        what is difference between xpath and context objects?

    Rohit,
    Check this thread for bhavesh reply for this:
    Context object
    ---Satish

  • Oracle ADF conformity with XHTML and DOM Level 2

    Dear all,
    I wonder if Oracle ADF 10g can produce documents that confirm with the XHTML and DOM Level 2 standards. I searched in Google but it is little hard to figure out

    Ok, but I taught that after importing myModel2 in myModel1, Jdeveloper realise a merge and it visualizes a unique package, even if it is splitted on two or more projects/models.
    So that, it seems to me this procedure is useful for importing jar file, but not for splitting a very big project in a lot of smaller projects, doesn't it?
    Thanks for your opinion
    Andrea

  • Embedded Quicktime movies and DOM layering?

    Is there any way to overlay something on top of a quicktime movie in a web page without the quicktime movie showing through it?
    http://www.boozhowtooz.com/trailer
    I have a low res and high res version of a trailer where clicking the high res link overlays the movie in the a thickbox on the page. depending on the browser, the low res movie with show through the layer.
    I've been searching the web for a solution but the best one I've found is to remove the low res movie with javascript when the high res link is clicked. not exactly ideal but doable if that's the only thing that works.
    Is this a general problem with the quicktime plugin and dom layering?

    I'm sorry for saying that David, but you are not right in this point. You would have right if you say that every web page embedded object (flash, quicktime, activx, etc.) has a parameter (wmode, window mode) which is set to true by default. BUT if you are using flash object (flash video) you can set the wmode parameter - as far as I know there are no other embeddable objects which accept this parameter.
    And I think it's a bug, and not in browsers but (in this case) in Quicktime - I can't understand why Apple can't solve this problem. It's one key problem why most web developers (neither I) can't use QT on more complex web pages or in web applications. Easy examples:
    __ you can't drop a popup over a QT video (you can do it with a Flash video)
    __ you can't embed QT into fixed header/footer web pages with scrolling content (it overflows the header/footer
    __ you can't put any navigation over QT objects (imagine the situation: I'm working on an UI which has self slide-bar to navigate within a video, you can add/remove annotations, logs, messages etc. and not for just one video but for more synchronized ones > you I'll need a scroll-bar to display all of these, but if you scroll the videos 'under' the navigation hides the navigation...)
    So to conclude this short message: In my opinion this is a big problem with Quicktime, and I'm wondering why such a big company like Apple can't manage this problem (probably the web 'market' of QT is not big enough - in fact this is an issue why web developers don't like QT embeds...)
    Thanks.

  • XPATH and the C parser

    Can I use an 'XPATH' expression to find a node using the C parser?
    eg find '/A/B/C'
    The Oracle Java parser supports this.
    Thanks for your help.
    Doug

    Yes, we have Xpath and XSLT support in the parser.

  • XPath and ERMS

    Hi gurus,
    We're creating our own Services for ERMS (CRM 6.0) and I was after a spot of advice.
    Can anyone give me some guidance as to where to find all the XPATH entries available? 
    In the ERMS Repository there are attributes defined with XPATH entries against them, but I'm sure there must be other XPATH entries available, and if we wanted to define our own attributes I was wondering where I could look to find this XPATH information?
    Thanks in advance,
    Andrew G.

    Hi !
    WSDL, XSD, Xpath and BPEL are all open standard.
    ABAP for instance, is not an open standard.
    look at the below URL's for more details
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cfab6fdd-0501-0010-bc82-f5c2414080ed
    BPEL in a Nutshell
    WS-BPEL 2.0 from OASIS - How it has progressed since BPEL 1.1
    BPEL Glossary for Developers
    Regards
    Abhishek

  • XPath and XQuery

    Hi all,
    What's the difference between the XPath and XQuery, can XPath has better performance than XQuery?
    Regards,
    Jane

    shree wrote:
    1.Can you differentiate these XSLT, XPath and XQuery.XSL stands for EXtensible Stylesheet Language, and is a style sheet language for XML documents. XSLT stands for XSL Transformations.
    XQuery is to XML what SQL is to database tables. XQuery was designed to query XML data.
    XPath is used to navigate through elements and attributes in an XML document. XPath is a major element in W3C's XSLT standard - and XQuery and XPointer are both built on XPath expressions.
    http://www.w3schools.com/xsl/default.asp
    http://www.w3schools.com/xquery/default.asp
    http://www.w3schools.com/xpath/default.asp
    Cheers,
    Vlad

  • Xpath and BPEL

    What is xpath and BPEL?

    Hi !
    WSDL, XSD, Xpath and BPEL are all open standard.
    ABAP for instance, is not an open standard.
    look at the below URL's for more details
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cfab6fdd-0501-0010-bc82-f5c2414080ed
    BPEL in a Nutshell
    WS-BPEL 2.0 from OASIS - How it has progressed since BPEL 1.1
    BPEL Glossary for Developers
    Regards
    Abhishek

  • XSLT, XPath and XQuery

    Hi,
    1.Can you differentiate these XSLT, XPath and XQuery.
    2.How Do I Force a Rollback in a BPEL Flow.
    Thanks in advance

    shree wrote:
    1.Can you differentiate these XSLT, XPath and XQuery.XSL stands for EXtensible Stylesheet Language, and is a style sheet language for XML documents. XSLT stands for XSL Transformations.
    XQuery is to XML what SQL is to database tables. XQuery was designed to query XML data.
    XPath is used to navigate through elements and attributes in an XML document. XPath is a major element in W3C's XSLT standard - and XQuery and XPointer are both built on XPath expressions.
    http://www.w3schools.com/xsl/default.asp
    http://www.w3schools.com/xquery/default.asp
    http://www.w3schools.com/xpath/default.asp
    Cheers,
    Vlad

  • Does the XMLP full or partially support the Xpath and XSLFO syntax?

    Does the XMLP full support the Xpath and FO syntax? or partially? Thanks

    Hi Robin
    OK, so hopefully you are not leading me into a trap here :o)
    There are two parts to this question:
    1. XPATH - we support as much of the XPATH spec as the Oracle XDK supports ie we rely on the XDK for our transformation engine so as long as they support what you are trying to do then we do. There are a few gaps and we have plugged those in the XMLP layer. So the short answer is yes.
    2. XSLFO - we allow you to use XSLFO in your template. The XMLP engine supports much of the standard but there are a few gaps. the next set of docs will layout exactly what we do support in the spec.
    Regards, Tim

  • XPath and dom4j xs:date() conversion exception

    Hey all Java folks
    I'm having a hard time deadling with XPath and date datatype using dom4J and seeking for guidance :)
    Let say I have the following XML header:
    <site:Blog xmlns:site="http://xml.netbeans.org/schema/blog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://xml.netbeans.org/schema/blog blog.xsd">and this expression :
    site:Blog//site:Entry[@date=xs:date('2007-09-07')]In XMLSpy I do get correct results but in my java code all I get is this exception:
    org.dom4j.XPathException: Exception occurred evaluting XPath: /site:Blog//site:Entry[@date=xs:date("2007-09-07")] Exception: No Such Function xs:date
    at org.dom4j.xpath.DefaultXPath.handleJaxenException(DefaultXPath.java:374)
    at org.dom4j.xpath.DefaultXPath.selectNodes(DefaultXPath.java:134)
    at org.dom4j.tree.AbstractNode.selectNodes(AbstractNode.java:166)
    at com.mor.blogengine.util.xpath.SearchEngine.getEntriesforDate(SearchEngine.java:142)
    at com.mor.blogengine.util.xpath.SearchEngineTest.testGetEntriesforDate(SearchEngineTest.java:120)Does anyone has a clue of why it works perfectly outside of JAVA but not within my code ?
    Any enlightenment is welcome! :)
    Laurent

    String xPathExpr= "/documentFiles/documentFile[xs:date(documentDateXML) > xs:date(\"2005-05-21\")]";should of course be
    String xPathExpr= "/documentFiles/documentFile[xs:date(documentDate) > xs:date(\"2005-05-21\")]";

  • Xpath and Get XML Document Data

    Good Morning,
    I have just recently gotten involved in a project that requires communicating with some web services (axis2). We have existing scripts that handle this already, but they were built when we weren't on axis2 so now the XML output from the web service call is slightly different and i am no longer able to use the same xpath statement in the Get XML Document Data step.
    I am receiving either null values or a prefix namespace error. I am new to xpath and have been reading as best i can from http://www.w3schools.com/xpath/ to try and understand how to write my statements to pull out the data i want correctly.
    I have read that sometimes the editor has problems if the XML contains namespace declarations, etc.
    Below is an example XML output where I'd like to be able to read the value in the ax211:success. My xpath gets prefix namespace errors as it doesn't recognize ax211.
    Xpath: /descendant::ns:validateCertificationResponse/child::ns:return/child::ax211:success
    Perhaps my xpath statement is just incorrect and wouldn't retrieve what i expect it to....
    Any advice is appreciated.
    Thanks,
    Kevin

    Hi,
    well, it appears that text() is automatically appended to the XPath query for some reason in UCCX, this is why you actually see the text node within the ax211:success element. This //*[local-name()="success"] select the whole node, not its first child (which is actually the first element, which also happens to be a text).
    Anyway,
    // - anywhere
    * - any node
    And within this "everything" you actually search with the condition within the angular brackets.
    G.

  • Using XPath for DOM traversal

    This question falls into the category of 'I know it's possible, I just need to find the idom in Java'.
    I'm coming from a MSFT world were the DOM-centric model of XML processing makes heavy use of XPATH for node selection. Basically using the method element.selectNodes(XPathExpresson) allows one to quickly extract the relevant subset of the parsed tree in the DOM as a nodeList. I've become accustomed to using XML for all strucutured storage that doesn't require a full database.
    The W3C DOM Level 3 spec supports evaluateExpression() for this purpose, but I can't believe that Java developers are still using tree traversal waiting for the spec to be implemented. I suppose that I could use getNodesByTagName(), but this is a chainsaw, and I need a scalpel. Anyway, I'm trying to figure out how, exactly, this gets done in Java.
    I figure the following are possibilities:
    1) It's in JAXP and I missed it
    2) One or more of the XML parsers supports XPATH as an extention
    3) There's a common package that sits on top of the DOM Document.
    4) There's a standard way to apply and XSLT methods to the DOM document
    5) Something I've never thought of.
    This is a generalized problem for me, so I can't rely on object serialization, Java-XML data mapping, etc. Any guidance would be greatly appreciated.

    I've written a Config file reader for XML in java,
    and it extracts values using XPath. This is
    some of the code you'll need:
    imports:
    import javax.xml.transform.TransformerException;
    import org.w3c.dom.*;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.apache.xerces.parsers.DOMParser;
    import org.apache.xpath.XPathAPI;
    import org.apache.xpath.objects.*;
    Document doc=....;
    * returns a single DOM Node from the config file.
    public Node getNode(String xpath) throws ConfigException {
    try {
    return XPathAPI.selectSingleNode(doc, xpath);
    } catch (TransformerException e) {
    throw new ConfigException("Can't find '"+xpath+"' ("+e.getMessage()+")");

  • Using transform api with xslt and DOM Nodes

    Hi,
    when trying to transform a xml document with xslt using the javax.xml.transform api
    providing an element node of a previously parsed document, I find that absolute
    paths are not recognized.
    The following program shows what I am basically doing (the class can be executed
    on the command line providing a stylesheet and xml instance):
    import java.io.*;
    import org.w3c.dom.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import javax.xml.parsers.*;
    class Transform {
    public static void main(String [] args) throws Exception {
         TransformerFactory tfactory = TransformerFactory.newInstance();
         Transformer transformer = tfactory.newTransformer(new StreamSource(args[0]));
         DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder parser = dfactory.newDocumentBuilder();
         Document doc = parser.parse(args[1]);
         Element domElem = doc.getDocumentElement();
         // workaround
    //     StringWriter out = new StringWriter();
    //     Transformer id = tfactory.newTransformer();
    //     id.transform(new DOMSource(domElem),new StreamResult(out));
    //     String xml = out.toString();
    //     transformer.transform(new StreamSource(new StringReader(xml)), new StreamResult(System.out));
         transformer.transform(new DOMSource(domElem), new StreamResult(System.out));
    transformer.clearParameters();
    If I use this on e.g.
    xsl:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output indent="yes" encoding="ISO-8859-1" method="xml"/>
    <xsl:template match="/">
    <xsl:value-of select="/foo/bar"/>
    </xsl:template>
    </xsl:stylesheet>
    xml:
    <foo>abc<bar>def</bar></foo>
    I get
    <?xml version="1.0" encoding="ISO-8859-1"?>
    abcdef
    instead of
    <?xml version="1.0" encoding="ISO-8859-1"?>
    def
    I think this is due to the fact, that the transformation does not recognize
    any absolutely adressed xpath correctly.
    From what I read in the API docs, I think what I'm doing should be ok.
    So: did I misunderstand something or is this a bug in the java libraries?
    I'm using j2sdk 1.4.1_01 on i386 linux.
    If I use the commented code (serializing the xml and doing the transformation
    with a StreamSource, that has to be parsed again), everything's fine.
    Of course it would be easier to parse the file directly in the example but in the
    real program, I already have a dom tree and want to transform a part of it.
    Any help appreciated.
    Thanks, Morus

    why?
    that's all the point of XSL: define what part of your
    XML you want in your XSL templates, there is no need
    to prepare a sub-DOM of your DOM.
    Ok. Right. That's an alternative.
    The problem remains, that there are some stylesheets originally written
    for the current solution and though they should work with the whole document
    as well, it's not certain.
    Actually I don't know if this ever worked. I did neither write this code nor maintained the system so far.
    btw. you would be faster by giving a StreamSource to
    your transformation.Probably yes. But that would imply to rewrite a lot of code.
    What is happening is:
    there is a SOAP answser containing a xml document as the result parameter.
    The SOAP answer is parsed (I guess by the soap classes already) and the
    result xml is extracted. That's where the element node I'm trying to transform
    stems from.
    Besides, I still don't see why DOMSource takes any node if only document nodes
    work.
    Thanks, Morus

Maybe you are looking for

  • Problem with iPod/iCal sync through iTunes.

    Hey all. Okay, I have a 30GB iPod with synchronization between iCal, Address Book, and the iPod through iTunes. It works - except I have a recurring appointment on Friday nights that shows up as Thursday nights on the iPod calendar. Any ideas? xposti

  • How can I get all category to show in ibooks? It is only showing 6 types.

    How can I get to show all categorias in ibooks, it is only showing 6 types on my iPad2. I bought tur. Ipad2 in france.

  • Itunes will not open windows 7

    itunes will not open in windows 7   c == runtime library error

  • Install fail - dark grey screen

    I just downloaded Mavericks and did a restart when prompted. After the restart the Apple logo appeared and then the spinning wheel. After about 15 more seconds the Mac goes pretty much quiet and the screen becomes dark grey. After a forced restart it

  • Getting Warning about Redirection url

    Hi, we have the the portal application running on the weblogic 11g and upon login, home page of our app is loaded, but I do see the following warning message on the portal server logs. Any idea how we can supress this warning? <Warning> <netuix> <BEA