How to use Xpath to query elements loaded from different xml docs?

I have a big DBLP XML doc (95mb), to load into the container, i splitted the doc into many small xml docs by the publication types, such as articles, books, inproceedings, etc.
I tried to use xpath query such as
query 'collection()/dblp[article/author]/book[title]'
I got empty answers.
but if i use XQuery such as
query 'let $r:=collection()/dblp,$a :=$r/inproceedings/author
for $l2 in $r/book
where $a and $l2/title
return <result> {$l2}{$a}</result>'
i got answers. However, if i remove {$a} from the return clause, i still got empty answers.
is there any problem with my Xpath query and flwor Xquery?
regards,
xiaoying

Hi John,
Following is the procedure i have used to load the xml docs (after the indexes have been created):
private static void loadXmlFiles(File path2DbEnv,String theContainer, File file) throws Throwable {
     //Open a container in the db environment
          XmlManager theMgr = null;
          XmlContainer openedContainer = null;
          myDbEnv env;
          try {
          env = new myDbEnv(path2DbEnv);
     theMgr = new XmlManager(env.getEnvironment(), new XmlManagerConfig());
     //use node container
     theMgr.setDefaultContainerType(XmlContainer.NodeContainer);
               try{
               openedContainer = theMgr.createContainer(theContainer);
               }catch (XmlException e){
                    //if the container alreay exist, then open it;     
                    openedContainer = theMgr.openContainer(theContainer);
          //Get an update context.
          XmlUpdateContext updateContext = theMgr.createUpdateContext();
               String theFile = file.toString();
               String docName=file.getName();
          //Get the input stream.
          XmlInputStream theStream = theMgr.createLocalFileInputStream(theFile);
          System.out.println("Adding " + theFile + " to container " +
                         theContainer);
     //     Do the actual put
          openedContainer.putDocument(docName, // The document's name
          theStream, // The actual document.
          updateContext, // The update context
     //     (required).
          null); // XmlDocumentConfig object
          System.out.println("done.");
          //XmlException extends DatabaseException, which in turn extends Exception.
          // Catching Exception catches them all.
          } catch (XmlException e){
               System.err.println("Error loading files into container " + theContainer);
               System.err.println(" Message: " + e.getMessage());
               //In the event of an error, we abort the operation
               // The database is left in the same state as it was in before
               // we started this operation.
               throw e;
          finally {
          cleanup(theMgr, openedContainer);
Unfortunately, i waited for around 20 hours 148mb doc was not loaded; so i gave up.
Could you please give me some suggestions on how to load the large doc efficiently ? thanks.
regards,
xiaoying

Similar Messages

  • How to use dynamic select query which queries from 3 different table.

    Hi All,
    I am new to Toplink, i would like to use a named query to select some of the columns from 3 different tables with dynamic where clause.
    I have used the following lines. Please tell me how to get code for the dynamic where clause.
    First try :
    Vector objPersons = (Vector)session.executeQuery("findPersonByGlobalID",Person.class,vQueryArguments);
    The above method is not returning the vector or collection.
    Second Try:
    ReadAllQuery query = new ReadAllQuery(Person.class);
    query.useCollectionClass(LinkedList.class);
    LinkedList person = (LinkedList) session.executeQuery(query);
    The second try is returning the collection but, this fetches all the record from the table.
    1. How to query for range of records?
    2. How to query from multiple tables for some range. How to use dynamic range values ?
    Please reply with your answers or some pointers would help.
    Thanks and Regards,
    Vijay.B

    Hi,
    Did you try using a SQLCall ? It might be able to satisfy you requirements .. :-
    Employee employee = (Employee) session.executeSelectingCall(
        new SQLCall("SELECT * FROM EMPLOYEE WHERE EMP_ID = 44")
    );You can get more information here :-
    http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/qrybas004.htm
    Regards,
    Sandeep

  • How to use adobe email in elements

    how to use adobe email in elements 11

    I am referring to the email option of having the photos embedded in the text and not as an attachment.  It is called Photo Mail in Organizer where you add the photos, then choose stationery & border layouts, etc.  I don't have have access to Outlook or any other type of email account.
    The only way for me to send photos direct from Photoshop Elements is by using Adobe email service. I had no problems in earlier versions, but this option does not work in Version 11. When I tried to use the email in version 9 (after I loaded version 11), I kept getting error messages that it was no longer available or supported.
    This option is found in Organizer, Preferences,Shating, Adobe E-mail service (from the email menu).
    Thanks

  • How to use the FormDownload UI element?

    Hi, 
       I am a newbie in ABAP Webdynpro and I want to know how to use the FormDownload UI Element. Any hints plz? Thanks in advance.

    Hi,
              I used CONVERT_OTF FM to convert the otf data to pdf data.  In my form user has the option to view the smartform (a button) or to directly download the pdf from smartform output without displaying the output. While the former has been taken care of by using InteractiveForm UI element and is displaying the smartform output fine, I am not being able to implement the second option. I have given a supply function to the pdfsource context node but am clueless about what to write to pass pdf data. In the sam WD component WDR_TEST_EVENTS, the FileDownload is used to save a text file with just one line. But how can I save a pdf file? I have assigned mime to application/pdf. How will I proceed now? Please suggest. Thanks in advance.

  • How to use Xpath effectively with Java

    I am using Xpath for parsing a String with following syntax.This is a string suppose String xmlShopstring.
    <shopper>
                <upc>0123456789</upc>
                <desc>Planeters Peanutus</desc>
                <regprice>1.99</regprice>           
                <errorcode></errorcode>
            </shopper>In this case how can I use xpath parsing ?

    You can use classes from javax.xml, org.w3c.dom packages for performing XML operations in java.
    These APIs have very rich set of classes and methods for performing XML operations effectively.
    pravi.pravi wrote: how can I use xpath parsing?You need to parse XML String to org.w3c.dom.Document with use of following classes:
    javax.xml.parsers.DocumentBuilderFactory
    javax.xml.parsers.DocumentBuilderOnce you parse XML String to org.w3c.dom.Document you can use following classes and others for very effective XPath parsing.
    javax.xml.xpath.XPathFactory
    javax.xml.xpath.XPath
    javax.xml.xpath.XPathExpression
    javax.xml.xpath.XPathConstantsI have listed some classes which can help you to perform XPath parsing, you should also explore other classes in the API for more XML operations.
    Refer thread: http://forums.sun.com/thread.jspa?threadID=5357836
    Thanks,
    Tejas Purohit

  • Hi Any body Knows How to use CAT Tool for Up Loading?

    Hi
    If any body knows how to use CAT Tool for up loading transactions, explain the steps.
    Our requirement is, we want to up load transactions like Oppor , Quotation,Order etc...we want to up load these transcations from Local system to CRM Server
    how to do this? Let me know the steps.
    Regards
    Venkat

    If you have 10,000 or less, CATT is a reasonable method, but I would suspect that you have far more than that if you're needing to load transactions.
    LSMW is probably a better way to go if you have more than 10k, but I am not familiar with LSMW

  • How to use WMI to query to distinguish legacy and UEFI mode Windows?

    How to use WMI to query to distinguish legacy and UEFI mode Windows?

    This document covers requirements for UEFI support.
    http://msdn.microsoft.com/en-us/windows/hardware/gg463144.aspx
    One of the requirements seems to be ACPI. The Win32_BIOS class of WMI has a BIOSCharacteristics property that indicates if ACPI is supported. See this link for properties exposed by Win32_BIOS:
    http://msdn.microsoft.com/en-us/library/aa394077(v=VS.85).aspx
    There is a PowerShell example showing how to get this information at the bottom. You will need to study the document in the first link to see what else is required.
    Richard Mueller - MVP Directory Services

  • How do I transfer my photoshop elements 11 from my pc to my mac?

    How do I transfer my Photoshop Elements 11 from my pc to my mac?  If I try to download it off the website, it wants my to download Photoshop Elements 12 which doesn't recognize my seriel number.  I don't want to buy Photoshop Elements 12.  I want to use my Photoshope Elements 11.

    if you follow all 7 steps you can directly download a trial here:  http://prodesigntools.com/photoshop-elements-11-direct-download-links-pse-premiere-pre.htm l
    and activate with your serial number.
    if you have a problem downloading, you didn't follow all 7 steps, or your browser does not accept cookies. 
    the most common problem is caused by failing to meticulously follow steps 1,2 and/or 3 (which adds a cookie to your system enabling you to download the correct version from adobe.com). 
    failure to obtain that cookie results in an error page being displayed after clicking a link on prodesigntools.com

  • How can I move my Premiere elements 8 from my old pc to my new imac?

    How can I move my Premiere elements 8 from my old pc to my new imac?

    tenfootprints
    Does your imac come with a Windows Mac interface?
    If not, you cannot. There is no Premiere Elements 8 Mac version. And, you cannot install Premiere Elements 8 Windows on
    a Mac computer. As I recall, Premiere Elements 9.0/9.0.1 was the first Premiere Elements version to be offered in Windows and Mac versions.
    Please explain with more details.
    Thanks.
    ATR

  • QuestionJust purchased a USB Super Drive but unsure how to use it - o instructions provided apart from how to eject a cd.  Each time I put in a cd it just ejects it again.

    Just purchased a USB Super Drive but unsure how to use it - o instructions provided apart from how to eject a cd.  Each time I put in a cd it just ejects it again.Can anyone help.

    USB is rarely bootable under Mac OS X and PowerPC Macs.   Get a Firewire Superdrive from http://www.macsales.com/ if your intent is to boot the machine.   PPC, which is PowerPC, indicates the Mac predates 2006.

  • Help me!    How to use it as a web service from third party application?

    After using JDeveloper to develop BSSV object e.g. JP550010, how to use it as a web service from third party application?
    TKS!

    Obviously the OP is working on a project for the Bead Society of Southeastern Virginia http://www.bssv.org. Oh, wait, maybe he's researching the Blueberry Shoestring Plant Virus http://abbreviations.yourdictionary.com/bssv
    :D
    John

  • How to use utl_ftp package to transfer files from one system to another

    Hi all,
    How to use utl_ftp package to transfer files from one system to another using plsql procedure .
    I failed to find the appropriate document ,kindly help me .
    Thanks,
    P Prakash

    prakash wrote:
    I am sorry tell you, this blog is not enough to for me.It's not a blog, it's Chris' website where you download the package from. Once you download the package and unrar it, then the package spec gives instructions (and I think there's instructions on how to install it too).
    Kindly let me know if there is any oracle documentation for this .It's not an Oracle created package, it was created by Chris. It's based around the UTL_TCP package if you really want to get into the nitty gritty of how it works, but I don't think you do.

  • HT5616 How can I use my apple ID to buy from different app stores (different countries)?

    How can I use my apple ID to buy from different app stores (different countries)?

    You can only use a country's store if you are in that country and have a billing address in that country on your account - are you in the country that you want to buy content from ? If you are then you can update the billing address on your account to be your address there (if using a credit card then that will need to have been issued by a bank in that country) via the Store > View Account menu option on your computer's iTunes.

  • Why are these classes equal? Loaded from different classloaders.

    I thought that classes loaded from different classloaders were seen as different in the JVM? But this code prints true to every check:
    try
         Class c = new URLClassLoader( new URL[] { new URL( "jar:file://home/tests/test.jar!/" ) } ).loadClass( "Test" );
         Class c2 = new URLClassLoader( new URL[] { new URL( "jar:file://home/tests/test.jar!/" ) } ).loadClass( "Test" );
         System.out.println( ( c == c2 ) );
         System.out.println( ( c.equals( c2 ) ) );
         System.out.println( ( c.getName().equals( c2.getName() ) ) );
    catch (Exception e)
         e.printStackTrace();
    }

    DrClap wrote:
    The more unbelievable thing is that this:
    System.out.println( ( c == c2 ) );prints "true". That shouldn't happen, and it's nothing to do with facts about classloaders. It shouldn't happen because "new" called twice should produce two different objects, no matter what kind of objects they are.
    I didn't try your code because I would have had to spend a couple of minutes creating suitable jar files. But did you actually run that code? Or is it a reduction of some larger piece of code and you just assumed it would do what you said it does? Because I don't believe that.I actually ran the code and every line DID print out true. This is in Java 1.5.
    I figured out why they're all true though - it's because the jar file was in the classpath, so the classes were loaded by a different classloader (the same one). When I put the jar out of the classpath, the statments printed out like this:
    //false
    System.out.println( ( c == c2 ) );
    //false
    System.out.println( ( c.equals( c2 ) ) );
    //true
    System.out.println( ( c.getName().equals( c2.getName() ) ) );I agree on the first one printing true but I seem to remember something about how they changed that rule in Java 1.5. I could be wrong but in c++, that would be a completely valid true statement (assuming your class implemented the "==" operator), so maybe they changed it to be in line with that?

  • How to use XPath with Namespaces in the xml ?

    Hi all,
    I need to reference a certain Node in a Document using XPath notation.
    The problem is the the XML Document contains Namespaces inside it
    f.e.
    <xn:SubNetwork id="JRANM">
        <xn:VsDataContainer id="1">
           <xn:vsDataType>vsDataAreas</xn:vsDataType>
        </xn:VsDataContainer>
    </xn:SubNetwork >Using DOMXPath (from weblogic.xml.xpath)
      DOMXPath xPath = new DOMXPath("xn:SubNetwork/*");
      Set nodeset = xPath.evaluateAsNodeset(this.xmlRootElement);When I Iterate through the Set I can see it's empty.
    (On the other hand without namespaces everything is fine.)
    So how can I reference a Node that contains a namespace in it ?
    Thanks a lot
    Francesco

    We use the following class to perform XPath Queries on our XmlBean objects.
    Hope this helps,
    Craig
    import java.util.Set;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.apache.xmlbeans.XmlException;
    import org.w3c.dom.Document;
    import weblogic.xml.util.StringInputStream;
    import weblogic.xml.xpath.DOMXPath;
    * Class to encapsulate API specific (i.e. weblogic) XML functions
    public class XmlUtil {
         * Returns a set containing objects of type reflected in the query.<br/>
         * e.g.<br/>
         * /saur:tree/saur:treeNode[@label='My Reports']<br/>
         * Returns a Set of TreeNode objects<br/>
         * Sample Code: <br/>
         * <code>
         * Set set = XmlUtil.executeXPathQuery( myQuery, tree.xmlText());
         * for( Iterator iter = set.iterator(); iter.hasNext();) {
         *     TreeNode node = TreeNode.Factory.parse((Node)iter.next());
         *     // Do whatever...
         * </code>
         * @param query
         * @param xml
         * @return
        public static Set executeXPathSetQuery( String query, String xml) throws XmlException {
            try {
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();   
                factory.setNamespaceAware(true);
                DocumentBuilder builder = factory.newDocumentBuilder();
                StringInputStream in = new StringInputStream(xml);
                Document doc = builder.parse(in);
                DOMXPath xQuery =  new DOMXPath(query);
                return xQuery.evaluateAsNodeset(doc);
            catch(Exception x) {
                throw new XmlException("Error running XPath query", x);
    }

Maybe you are looking for