• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

need a point in the right direction using XMLTYPE, dbms_xmlgen.convert, dbms_xmlgen.ENTITY_DECODE

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there

So I have migrated a web service from oas10 to weblogic. This has caused a change in the xml returned by that web service, and the old way of converting the return xml to useable form no longer works.

I have some pl sql code (I did not write that code, which is why I am having some trouble), that would take the xml from the web service and convert it to useable form. The line that does this operation:

This would take xml that looked like this (I had to make all & gt; and & lt; to >t and <t, otherwise they would be converted to < or > - I hope this is not too confusing):

and convert it to this:

As you can see it just took the stuff in the middle that used gt's and lt's and converts it to > and < and returns it as a nice little bit of readable and parseable xml.

Now with the change to wbelogic, before the conversion, the xml looks like this (again had to use above to make gt and lt not turn into actual symbols):

And the line to convert it to useable form does not work any longer. The code is stopped dead at that point.

I am not looking for the answer explicitly, I am sure some of the pl sql vets see immediately what needs to be done. Just a point in the right direction to resolve this myself. A few terms to google maybe, or some useful tutorials you know of - that kind of thing. Just some tips to get the ball rolling quicker. I could go the long way and start from the very beginning myself, but it is almost xmas and I want to get this off my plate!

By the way, changing the xml output is not the option I want to pursue, so if that can be avoided that is what I am looking for - just a nice, quick pl sql fix.

Thanks!

ps - right now I am researching dbms_xmlgen.convert and dbms_xmlgen.ENTITY_DECODE - so if that is all i should need to put me on the track to answering this then don;t worry about replying (or reply and say that should get me where I need to be)
 
Ranch Hand
Posts: 182
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exact error do you get?

After unescaping xml entities (& lt; and & gt;) this piece of code works fine for me.


which gives an xmltype element of


You may look at Using XMLType document from Oracle.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No error, code just stops dead and the transaction times out.

So you are saying you used the xml with > an < instead of >s; and <s;; and fed that in? Or that you did use >s; \ <s; and your code converted it? Before my change, that line of code above from my first post would convert those characters first, and then send out the correct xml. I know because I put insert into statements right before and after that line - so that line is definitely where code is just stopping.

However, changing the >s; and <s; before that line is not something I know how to do with pl sql, so I may need to look into that. I notice you do not use dbms_xmlgen.ENTITY_DECODE in your code, maybe that is what that procedure does - I will need to research it.

Thanks, you gave me an idea where to start and that is what I was looking for.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again Faith, you helped me figure this one out petty quickly. I just thought I would post the solution that worked for my case if anyone else fins it helpful in the future:

 
reply
    Bookmark Topic Watch Topic
  • New Topic