Subject:Adding a namespace Author:rajat nair Date:07 Jan 2008 05:33 PM
Hi,
I m trying to add a namespace to a document created by the mapping utility,but whn i do declare default namespace like,
declare default element namespace "http://www.openapplications.org/oagis/9";
the result omits all the data grabbed by the mapping and gives only a blank xml even though i have the required namespace added.
This is what i need to be present in the outgoing document,
I read the following article from datadirect regarding this, but the problem is i do not want to declare a namespace and then use it, because in that case it would have a prefix which may not be recognised by our warehouse software.Any help would be greatly appreciated.
Subject:Adding a namespace Author:Minollo I. Date:07 Jan 2008 05:57 PM
...BTW, if that's the problem you are hitting, and you cannot use a prefix for the namespace you are trying to use, probably the easiest way to proceed is to change your XPath expressions (/a/b/c, for example) to use "*:" to make sure they match any namespace... (/*:a/*:b/*:c)
Subject:Adding a namespace Author:rajat nair Date:08 Jan 2008 04:43 PM
Hi,
The solution mentioned by worked,but i had another question associated with the same issue, hence decided to keep it in the same thread,the default namespace now shows
<ProcessPurchaseOrder xmlns="http://www.openapplications.org/oagis/9">
but the complete information in that tag should also contain a release id, something like this
<ProcessPurchaseOrder xmlns="http://www.openapplications.org/oagis/9" releaseID="9">
How do i go about adding in this extra text?
Subject:Adding a namespace Author:Minollo I. Date:08 Jan 2008 04:50 PM
...the same way you would create an attribute for any output element... We don't have your XQuery, so it's difficult to tell you more; maybe you currently have something like...
...
<ProcessPurchaseOrder>
...
</ProcessPurchaseOrder>
...
Then change it to something like:
...
<ProcessPurchaseOrder releaseID="9">
...
</ProcessPurchaseOrder>
...
...or use releaseID="{some expression}" if the value of releaseID needs to be the result of a computed expression.