Siggi,
I have very limited knowledge of XPath/XQuery.
I don't know why your selectPath() call doesn't work. It seems right.
Can you say what version of XMLBeans you are using (2.0? 2.1? latest
svn?)
and also what version of Saxon?
I believe that $this works as advertised with the BEA XQuery engine,
but I'm not sure about Saxon.
Again, I know very little XQuery, but maybe you could try something
along
the lines of

let $cur := .
return //[EMAIL PROTECTED]/@id]

if $this is not working.
- Wing Yew

________________________________

From: Siegfried Baiz [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 16, 2006 12:29 AM
To: [email protected]
Subject: Re: selectPath with FilterExpression using $this


Hello Wing Yew,

yes, that's what I'm looking for. Do you have any idea, why 

 xo.selectPath("//[EMAIL PROTECTED]/@id]")

doesn't work (for my XmlObject xo with ID-Attribute 'id')?

Or is there some better why to receive all nodes 
(with idRef-Attribute) refering to my node xo?

 - thanks for your help - Siggi



Wing Yew Poon wrote: 

        Siggi,
        I think you're right. I guess what you need is a variable bound
        to the node represented by the XmlObject that you're executing
the 
        selectPath() from. "$this" is supposed to be that.
        - Wing Yew
        
        -----Original Message-----
        From: Siegfried Baiz [mailto:[EMAIL PROTECTED] 
        Sent: Wednesday, March 15, 2006 3:09 AM
        To: [email protected]
        Subject: Re: selectPath with FilterExpression using $this
        
        For the Expression  xo.selectPath("//[EMAIL PROTECTED]/@id]"
<mailto://[EMAIL PROTECTED]/@id]> ) I get an empty 
        result-array.
        
        Doesn't the left- and the right-hand-side of that
filter-expression
        always refer to the same node, which would mean,
        that the xpath-engine tries to select any nodes with
        the two attributes @idRef & @id having the same value?
        
        - Siggi -
        
          

                Siggi,
                can you try
                
                   xo.selectPath("//[EMAIL PROTECTED]/@id]"
<mailto://[EMAIL PROTECTED]/@id]> );
                
                and see if that works?
                - Wing Yew
                
                -----Original Message-----
                From: Siegfried Baiz [mailto:[EMAIL PROTECTED] 
                Sent: Tuesday, March 14, 2006 10:11 AM
                To: [email protected]
                Subject: selectPath with FilterExpression using $this
                
                Hello,
                
                for a given XmlObject xo with an ID-Attribute 'id',
                I've tried to launch the following xpath-expression:
                
                   xo.selectPath("//[EMAIL PROTECTED]/@id]")
                
                in order to get all nodes (with idRef-Attribute)
refering to my node
                    

        xo.
          

                Unfortunatlly this expression seems not to work. I
always get an
                java.lang.ArrayIndexOutOfBoundsException from the
underlying
        
net.sf.saxon.expr.XPathContextMajor.setLocalVariable(XPathContextMajor.
                    

        j
          

                ava:213)
                
                At
        
http://xmlbeans.apache.org/docs/2.0.0/guide/conSelectingXMLwithXQueryPa
                    

        t
          

                hXPath.html
                I found the following notice:
                        "Notice in the query expression that the
variable $this
                represents
                         the current context node (the XmlObject that
you are querying
                from).
                         In this example you are querying from the
document level
                XmlObject."
                
                After reading that sentence I've been thinking, that
$this is somehow
                similar to "curent()" in XSLT, but maybe a got the
meaning wrong.
                
                Does anyone know whats the problem here rsp.
                is there a better way to accomplish the same thing?
                
                Thanks a lot,
                
                Siggi
                
                
                
        
---------------------------------------------------------------------
                To unsubscribe, e-mail:
[EMAIL PROTECTED]
                For additional commands, e-mail:
[EMAIL PROTECTED]
                
        
_______________________________________________________________________
                Notice:  This email message, together with any
attachments, may contain
                information  of  BEA Systems,  Inc.,  its subsidiaries
and  affiliated
                entities,  that may be confidential,  proprietary,
copyrighted  and/or
                legally privileged, and is intended solely for the use
of the
                    

        individual
          

                or entity named in this message. If you are not the
intended recipient,
                and have received this message in error, please
immediately return this
                by email and then delete it.
                
        
---------------------------------------------------------------------
                To unsubscribe, e-mail:
[EMAIL PROTECTED]
                For additional commands, e-mail:
[EMAIL PROTECTED]
                
                
                 
                
                    

        
        
---------------------------------------------------------------------
        To unsubscribe, e-mail: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        
        
_______________________________________________________________________
        Notice:  This email message, together with any attachments, may
contain
        information  of  BEA Systems,  Inc.,  its subsidiaries  and
affiliated
        entities,  that may be confidential,  proprietary,  copyrighted
and/or
        legally privileged, and is intended solely for the use of the
individual
        or entity named in this message. If you are not the intended
recipient,
        and have received this message in error, please immediately
return this
        by email and then delete it.
        
        
---------------------------------------------------------------------
        To unsubscribe, e-mail: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        
        
          

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to