This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
as you might expect
However, if I try to get just the text, and not the <return>'s by adding /text()
Error at line 1
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of 'h'
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 272
ORA-06512: at line 17
Script Terminated on line 1.
I am stumped (again... today has been annoying..)
Could it have to do with the fact the xml is one line? Or is it possible the value in <return> is not /text()?
I have tried going further up in the xml tree, and adding namespaces, all of which I have done successfully before - I cannot figure out what is happening here though
True wisdom is in knowing you know nothing - Socrates
I'm just guessing there, but I'd say the problem is that the extract method correctly extracts the value (http://urltext), but it is not a valid XML and cannot therefore be passed to functions (in this case the XMLTYPE constructor) that expect XML snippets as input? That is, shouldn't you do:
where result would be declared as a clob?
You are correct, that was the problem. I was looking at some old work I had done like this, and made an incorrect assumption about the results I was storing (I thought I was storing the data in an XMLTYPE variable with just the string and no XML - turns out there is XML which I later parse out - your suggestion would be better for that older work too.
Thanks Martin, very helpful as usual