• 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

Trying to add xmlns attribute to a <result> tag in my xml response

 
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
I have an xml response from a bpel process. It has a <result> tag that includes all of the xml I need to parse. I need to make that <result> tag have an attribute - xmlns="http://..." - That means it would look like <result xmlns="http://...">

Here is the result <tag> in part of the actual response:



I need it to have an attribute xmlns="http://..." <result xmlns="htp://....">

Here is my .xsd file which has the only reference to the <result> tag I can seem to find (It is at the bottom):



So is there a new tag I will need to add nested within that <element name="result" type="string"/> tag, or do I need to add a new attribute to it? Or is there another way

It would be great if someone could help me with this one.

Thanks very much
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean, you want to declare that element to be in the default namespace with a particular namespace URI. I don't know much about schema but if you use the standard terminology you're more likely to be able to find the answer in the documentation.

Oh wait a minute... you said you want to parse it and it has to have that namespace declaration. In that case you'll have to contact whoever is producing the document and ask them to fix it. Or are you the one producing it? I'm a bit confused about what you are asking.

Edit: I looked again at the XML you're complaining about and that <result> element (not "tag", let's use the standard terminology) is already in the default namespace. The default namespace is inherited from its parent. You'll notice that the <QUOTE> element which is the child of the <result> element redeclares the default namespace so that it isn't in any namespace. So now I'm a lot confused about what you are asking. Can you go back a step and ask the earlier question which you thought adding a namespace declaration was the answer to?
 
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
I should start then by saying I am migrating some bpel processes from oas10 to weblogic

I have some pl sql that parses the xml



The last variable on each line, v_quote_name_space is causing an issue. If I remove it altogether my stuff works fine, but if it is there my process gets hung up and will not complete (it goes down to the end of the if-statement containing that pl sql).

I looked at the old version of the response xml, and it looks like this:



If you compare that to the current response xml the only real difference is that <response> element is missing the xmlns="" definition:



So I thought that meant I needed to add it there, but maybe I am wrong about that entirely then? I wish removing the v_quote_name_space variable from the pl sql were an option, but it is not.

Thanks
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I see. But what has actually changed is that in the new format you have this:

Which declares that the <QUOTE_XML> element and all its children are not in any namespace. Whereas in the old format, they were in the "http://xmlns.oracle.com/Get_Quote_XML" namespace. Presumably that namespace URI is the value of the v_quote_name_space variable in that PL-SQL code?

It seems to me that you want that <QUOTE_XML> element to just inherit the default namespace from its parent. Or are you looking for fixes to your PL-SQL code to make it work as before?

I have no idea how to achieve the former. As for the latter, I know basically nothing about PL-SQL but I would hazard a guess that there's a version of the EXTRACTVALUE function which doesn't take the third (namespace) parameter.
 
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
You are exactly right. In your assumptions and the pl sql fix. Unfortunately the pl sql fix is not an option, but I do have a better idea of what I need to do now. Thanks very much!
 
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
Turns out removing the name_space from the pl sql was the best option, so that is what I did; if you were wondering about it.
Turns out, that name_space variable was only there because it had to be there due to the way our old web services worked, so with the migrated version, this was no longer needed, so I just struck it from the code altogether. Made for an easy fix, and easier to debug pl sql code

Thanks for your help Paul, you always are able to set me on the right path.
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic