Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Xerces XmlSerializer + namespaces?

From: Philippe Poulard <Philippe.PoulardNO@----------.-----.-->
To: NULL
Date: 4/6/2005 11:49:00 AM
Mark wrote:
> Sorry if this has been answered before - I searched but could not find
> the answer.
> 
> If I serialize an element from within a document is there a way to
> force the output of the namespaces that are in scope on that element?
> 
> E.g. suppose I have:
> 
> <doc xmlns:fred="uri:fred">
>     <element attr="fred:something"/>
> </doc>
> 
> And I serialize <element> is there a way I can force the output of the
> xmlns:fred declaration too?
> 
> If you wonder where this question is coming from I'm actually working
> on using Castor to analyse the schema definitions from within a WSDL
> types definition!
> 
> Many thanks in advance for any intelligent answers!

hi,

did you check if your serializer didn't have an option such as "force 
output for unused xmlns declaration" ?
if your serializer doesn't have this feature, maybe you should change 
for another one (however, it seems that such a feature is somewhat 
unusual, i don't know if an existing serializer support it, sorry)

here is also a dirty hack :
<doc xmlns:fred="uri:fred" fred:xmlns="">
     <element attr="fred:something"/>
</doc>
using xmlns as a local name could have a special meaning "don't 
serialize this attribute" (but as it is present, serialize the xmlns 
declaration that declares the prefix) ; what people are thinking about 
that ?
-- 
Cordialement,

            ///
           (. .)
  -----ooO--(_)--Ooo-----
|   Philippe Poulard    |
  -----------------------


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent