![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Xerces XmlSerializer + namespaces? [Thread Next] Re: Xerces XmlSerializer + namespaces?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 | ----------------------- | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
