XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2017)
-> + Issue with Processing Instruct... (2)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> + Problem with http-post not bei... (3)
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> + Query and Sftp clent (4)
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
rajat nairSubject: 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,

<ProcessPurchaseOrder xmlns="http://www.openapplications.org/oagis/9" releaseID="9">

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.

Regards
Rajat Nair

Postnext
Minollo I.Subject: Adding a namespace
Author: Minollo I.
Date: 07 Jan 2008 05:42 PM
Difficult to tell without seeing the XQuery; but maybe you are hitting the issue described here? http://www.xquery.com/tips_and_tricks/xpath_and_namespaces.html

Postnext
Minollo I.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)

Postnext
rajat nairSubject: 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?

Regards
Rajat

Postnext
Minollo I.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.

Posttop
rajat nairSubject: Adding a namespace
Author: rajat nair
Date: 08 Jan 2008 04:56 PM
thanx a ton that did the trick
Regards
Rajat

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.