Thanks for your replies. I'm reading the best practices documents suggested by Rusty Wright. Good resource, I'm planning to read all of them since I think I lack an understanding of XML complexities in general.

Anyways,
You might be able to do something with XmlCursor
(prefixForNamespace(...) )to add the prefix and then use the XmlOption
(setSave ... ) to get this behavior.

I will try that.

I must ask though, why you need a specific prefix if you are working
with DOM implementations. Requiring a specific prefix will lead to
LOTS of maintenance issues.

Let me try to explain what I'm trying to do. We have a wrapper schema (METS) in which there are sections for other schemas (For example, one section contains a MODS schema - this is a library application). The resulting METS wrapper document can get pretty large and complex. So, for readability, I'm assuming it would be better if all the elements were namespace qualified. Each section can also include extensible (with schema any elements). It also has been the practice here so far.

I'm really curious about the maintenance issues you mention. Btw, the wrapper schema (METS) has elementFormDefault set to unqualified whereas the section schema (MODS) has it set to qualified. The wrapper is not generated by XMLBeans only the subsection. I'm not sure what effect this has on XMLBeans.

Thanks!

Hope this helps,
-Jacob Danner

On 6/12/07, Muzaffer Ozakca <[EMAIL PROTECTED]> wrote:
Hi all,

I'm using XMLBeans to create a document. Then I'm importing the
generated document into another DOM tree using the DOM API (by calling
getType.getDomMode() first to get the dom node from the XMLBeans
generated document and then calling importNode())

This is working. I'm now trying to force namespace prefixes on all
nodes. In other words, instead of:
<a>
    <b/>
    <c/>
</a>

I want:
<t:a>
    <t:b/>
    <t:c/>
</t:a>

where t is the namespace prefix. Is there a way to enable that? I played
with a few settings in XmlOptions but none worked so far.

I'm pretty new to XML processing with Java, I am hoping XMLBeans is
going to make it easier.

Thanks.

m

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to