|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Maintaining namespace for attribute typeGaragan, Sean Sean.Garagan at xwave.comThu Mar 11 08:44:33 PST 2010
Hi Martin, Thanks, that was something I missed (a lot of docs to sift through when learning XQuery!) Unfortunately, my implementation (in BEA ALSB 2.6) does not support that declaration. However, the in-scope-prefixes() function does work so I will try to use that to add the namespaces and hope that they do not get re-removed. Sean SAS Platform Team Work - 902.487.4993 Cell - 902.220.0946 -----Original Message----- From: Martin Probst [mailto:http://x-query.com/mailman/listinfo/talk] Sent: March 10, 2010 9:25 AM To: Garagan, Sean Cc: http://x-query.com/mailman/listinfo/talk Subject: Re: Maintaining namespace for attribute type Hi, did you find the copy-namespaces declaration? See here: http://www.w3.org/TR/xquery/#id-copy-namespaces-decl http://www.w3.org/TR/xquery/#id-element-constructor So I think if you declare copy-namespaces preserve, inherit; your namespace bindings should survive. If your implementation doesn't support that, you might achieve a similar effect with the function in-scope-prefixes. Regards Martin On Wed, Mar 10, 2010 at 14:07, Garagan, Sean <http://x-query.com/mailman/listinfo/talk> wrote: > Good day, > > > > I have been looking at this for a few days now and I cannot seem to figure > out a proper way via XQuery to maintain the namespace used in an xsi:type > when the namespace is not used with an element or an attribute. For > example: > > > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> > > <soap:Header > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> </soap:Header> > > <soapenv:Body> > > <abc:a > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:abc="http://demo/xml/abc" > > xmlns:xyz="http://demo/xml/xyz"> > > <!--Zero or more repetitions:--> > > <abc:b> > > <!--Zero or more > repetitions:--> > > <abc:c > xsi:type="xyz:EType">simpleType</abc:c> > > </abc:b> > > </abc:a> > > </soapenv:Body> > > </soapenv:Envelope> > > > > In this case, the inner <abc:c> has a type in the schema of anyType and in > this case has been typed as "xyz:EType". When this goes through an XQuery > transformation, the namespace declaration in the root of the message is lost > in the output. The transformations tend to be generic as these messages can > be many different types; this is for a message router in an ESB. My read of > the spec shows that the XQuery engine can remove namespaces not used in > elements or attributes and is allowed to ignore content. To me, the value > of xsi:type is not content but critical information (although yes, strictly > it is content). This gap in the spec suggests that XQuery cannot handle > dynamic typing and allow messages of anyType to be handled. > > > > Some additional information, these messages and schemas are externally > defined and cannot be changed so we need to handle these as-is. My question > is, is there a way to maintain the namespace or even retrieve the namespace > and insert it later via XQuery or do I need to update this elsewhere (such > as via Java code to re-insert the missing declaration)? > > > > Thanks in advance, > > Sean > > > > _______________________________________________ > http://x-query.com/mailman/listinfo/talk > http://x-query.com/mailman/listinfo/talk >
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






