Toad World® Forums

Testing function that returns XML


#1

I set up a test case for a function that returns an XML document. If the function “fails” it returns an empty root node. I tried to set up the outcome to check for a node down from the root (i.e. selected EXISTS operator - “XPath expression locates a node in the XML document?”). It sounds like this would provide exactly what I need. However, after selecting EXISTS, I click OK and get an exception (Internal error) and it attempts to generate a support bundle. Unfortunately, this is on a separate network and, therefore, I cannot actually send the bundle.

Any suggestions?
Let me know if you need further details.

Thanks a lot,
Mitch


#2

Mitch,

It would be extremely helpful to me if you would log a bug with Quest Support and generate a support bundle that includes the source code of the program you are testing and an export of the test definition (the support bundle creator will do this for you as long as you specify the name of the program on the appropriate page. If you don’t want to bother with Quest Support please send the information directly to me at steven.feuerstein@quest.com.

Many thanks, SF


#3

Steven,

In general, does it sound like the feature I was trying to use would meet my need (i.e. is that what the EXISTS operator is supposed to do with an XML doc)?

I’ll take a look to see how long it would take to get the support bundle reviewed and approved for transfer. I’ll let you know…

Thanks,
Mitch


#4

Yes, Mitch, I think that is what you should be using. We clearly have an error there.

I will open a bug report and we will take a look at it.


#5

Mitch,

Could you do this:

Email to me (steven.feuerstein@quest.com) an example of the XML document with an “empty root node” on which the test is failing? We will then hopefully be able to reproduce this more easily.

Thanks!
SF


#6

Mitch,

An update: it looks like we can reproduce it. One request:

When you get the internal error, could you take and send me the screenshot of the error?

Thanks, SF


#7

Another update:

Please try connecting to your repository schema and run this script:

BEGIN
UPDATE qu_assertion a
SET a.exp_dt_guid = NULL
WHERE a.universal_id IN
(’{2546C2F2-9F14-43A2-BACC-92118DDA0F57}’
, ‘{C35BCF76-1C78-44EC-8785-D508C8CB1D7F}’);

COMMIT;
END;

Then start up Code Tester and see if the problem goes away. Let me know what happens.

Thanks, SF


#8

Steven,

Sorry for the delay in my response.
It appears your suggestion has resolved the issue. The test case now compiles fine. I’m able to set the XPath expression, but I still need to figure out where I should define the namespace I use. Any suggestions?

Thanks a lot for the help,
Mitch


#9

Regarding namespace: I am sorry, but I am being slow on this one. What namespace do you need to specify, and for what?

Thanks, SF


#10

The namespace is referenced in the XML that is returned from the function. Therefore, the XPath expression seems to be having trouble without the namespace definition. For example, say the XML output is something simple like:

PL/SQL Pocket Reference

In PL/SQL if you try to call vXML.existsnode(’/book/lib:title’), it will complain b/c you don’t tell it what “lib” is. So, you need to say something like vXML.existsnode(’/book/lib:title’, ‘xmlns:“lib=http://mitch/library_schema”’). I’m guessing the issue with my test case in Code Tester is that I don’t specify the 2nd part anywhere.
Make sense?

Thanks,
Mitch