Hey thanks Phil Boy when I jump in I go in deep ;-) Ben Johansen - http://www.pcforge.com Authorized Witango & MDaemon Reseller Available for Web App. Developement
-----Original Message----- From: Phil Wade [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 5:40 PM To: [email protected] Subject: RE: Witango-Talk: XPATH ?????? Ben, Namespaces add a whole new complexity to finding the correct node using xpath. Your xpath makes the assumption that there are no namespaces and by removing the soap prefix from the XML you are in fact doing this. As your XML is defined like this you can see that a namespace has been defined for the LogonResponse branch. <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <LogonResponse xmlns="http://www.munge.com/WebService/ABAService"> <LogonResult>c8c799bb-3640-46f0-a0a3-b7105b5b646a</LogonResult> </LogonResponse> </soap:Body> </soap:Envelope>" Your xpath expression will only look in the default(no namespace) elements. What you should be asking for is this: <@ELEMENTVALUE request$testDOM xpath="//*[local-name()='LogonResult' and namespace-uri()='http://www.munge.com/WebService/ABAService']" encoding="html"> This tells the expression evaluator to find the elements called LogonResult in the namespace defined by the uri http://www.munge.com/WebService/ABAService > I find this very frustrating. That I have to massage the perfectly > good XML to work with Witango. Hmmmm, what can I say .... Yes the XML is "perfectly good", actually well-formed is the term to use, but after obviously being tortured by xpath and namespaces I think you may need the massage more than the Witango server. ;) Phil > From: "Ben Johansen" <[EMAIL PROTECTED]> > Date: 22 February 2005 2:51:17 PM > To: <[email protected]> > Subject: RE: Witango-Talk: XPATH ?????? > Reply-To: [email protected] > > The only way I was able to get it to work was to do @REPLACE > statements and remove the �soap:� and then I would get results back. > > � > > I find this very frustrating. That I have to massage the perfectly > good XML to work with Witango. > > � > > Ben > > � > > > From: Robert Garcia [mailto:[EMAIL PROTECTED] > Sent: Saturday, February 19, 2005 5:20 AM > To: [email protected] > Subject: Re: Witango-Talk: XPATH ?????? > > � > > Your xpath pointer looks correct, so I don't know why you are getting > an error, I use XQL and XPATH all the time and was one of the reasons > I upgraded to 5.5, so I hope you get this worked out. > > However, I don't think the result of your query would be the string > value, but a dom value of just that node. I am very interested to see > you work this out. I am setting up a test server this weekend to start > testing all my apps in 5.5, and start changing my xml methods to the > built in ones. Let me know what makes your xpath work. > > In my other development work, I have seen issues with case come up > sometimes, so I use this XQL query that will return the path ignoring > case. > > //*[translate(name(), "thepath","THPATH")='thepath'] > > so in witango: > > <@assign local$path "LogOnResult"> > <@assign local$xquery "//*[translate(name(), <@dq><@var local$path > format=case:lower><@dq>,<@dq><@var local$path > format=case:upper><@dq>)='<@var local$path format=case:lower>']"> > > I use this all the time, cuz I hate worrying about case. > > -- > > Robert Garcia > President - BigHead Technology > VP Application Development - eventpix.com > 13653 West Park Dr > Magalia, Ca 95954 > ph: 530.645.4040 x222 fax: 530.645.4040 > [EMAIL PROTECTED] - [EMAIL PROTECTED] > http://bighead.net/ - http://eventpix.com/ > On Feb 17, 2005, at 6:50 PM, Ben Johansen wrote: > > Ok the new 5.5 doc states > > �If the path starts with a slash (/) it represents an absolute path > to an element. If the path starts with two slashes (//) then all > elements in the document that fulfill the criteria will be selected > even if they are at different levels in the xml tree. > > � > > � > > So using the // means you can get to the element without all the > fixed path > > � > > So given the following dom data > > � > > <pre> > > <?xml version="1.0" encoding="utf-8"?> > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > <soap:Body> > > <LogonResponse xmlns="http://www.munge.com/WebService/ABAService"> > > �<LogonResult>c8c799bb-3640-46f0-a0a3-b7105b5b646a > > �</LogonResult> > > </LogonResponse> > > </soap:Body> > > </soap:Envelope>" > > </pre> > > � > > The following command > > <@VARNAME="request$testDom"XPATH="//LogonResult"> > > � > > Should equal = c8c799bb-3640-46f0-a0a3-b7105b5b646a > > � > > But this is what I get. > > � > > Error > > An error occurred while processing your request: > > File: aba_soap.taf > Position: Results > Class: Internal > Main Error Number: -903 > > The specified element cannot be found, or element specifier is empty. > The specified element can not be found > > Meta Stack Trace: > > Line > > Meta Tag > > 0024 > > � > > *The meta stack is interpreted top-to-bottom: the top line shows the > inner metatag that caused the error. > > � > > � > > What am I missing? ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
