Hi Cris, The easiest way of handling this may be to run your documents through some form of filter that adds a default namespace declaration to the root element of the document (if it's not already present). That way the namespace will automatically be applied to all the elements of the document that don't have a prefix. I'd suggest a simple java.io.FilterInputStream for this purpose - just do a scan of the start of the document to find the root element start tag, then add the namespace declaration if necessary. That way you can feed the output to the parser and assume namespaces everywhere without any special binding kludges.
- Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Cris Daniluk wrote: > This is a follow-up to a post I made earlier this week. I am working > with a set of documents that inconsistently use a namespace. > Basically, there are one of two situations - the namespace is > specified and corresponds to a specific URI, or it is not specified > and corresponds to that same URI. I'm wondering if there's a way I can > configure the unmarshaller to always assume that if a prefix is not > specified that it should be some preconfigured value, but that when > the document is round-tripped, that it ALWAYS include the namespace > prefix. > > Currently, I'm able to get the documents to unmarshal and marshal > correctly, but the system that I am pulling the data into after > binding is less tolerant of the namespace inconsistency in the source > documents. I'm hoping there's a JibX solution so that I don't have to > rewrite the XMLs before unmarshaling... > > Any help would be greatly appreciated. > > Thanks! > > - Cris > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users