|
Greetings, I'm using a variation of the GED family-tree xml application introduced in Michael Kay's XSLT book. There are two types of "records": indi and fam. I read an indi record, and from that get a value which is used as a key to a fam record. This key is just a string value. This much is working fine. The problem comes in trying to do a search for the fam record once I have the key value. I have tried using XPath, as below: parentFamRef = indi.getFamc(); parentFamRefKey = parentFamRef.getRef(); //-- this gets the key value for the fam record. XmlCursor famCursor = famRecs.newCursor(); //-- I'm using a cursor to do the xpath search. famCursor.toStartDoc(); //-- I placed the cursor at the start of the document. System.out.println(" Parent ref: "+parentFamRefKey); //-- printing out my key value. String searchPath = "GED/[EMAIL PROTECTED]'"+parentFamRefKey+"']"; //-- forming an xpath search string using the key value. System.out.println("searchPath: "+searchPath); //-- print out the search string. famCursor.selectPath(searchPath); //-- Here's where I do the actual xpath operation. System.out.println("at famCursor: "+famCursor.getTextValue()); //-- I never get here. Output is as follows: Parent ref: HF-1 searchPath: GED/[EMAIL PROTECTED]'HF-1'] Error: printItems: This query is too complex to be processed. [Ljava.lang.StackTraceElement;@a030d6 Now come on: this is not a complex query: what's going on here? I saw that I am supposed to put some additional jar files on the classpath to use xpath: xbean_xpath.jar and saxon8.jar, right? I think I've done that, and it made no difference. I've also tried this without using a cursor - same results. Can anyone tell me what's going on? I thought maybe I should build xbeans from the source, and downloaded that, but that has other problems, which I won't mention here. I have also not included any of the schema or the xml itself, but I could if it would help; I just wanted to keep it short. I've been able to make an xsl stylesheet file which uses this same xpath _expression_ and get it to work fine in Firefox. Thanks, Frank Huddleston |
- XPath failure: says it's too complex when it's not Frank Huddleston
- Re: XPath failure: says it's too complex when it's n... Frank Huddleston

