Eduardo B. de Souza wrote:

Hi all,

I have a xml file named "example1.xml" like this:

<?xml version="1.0" encoding="UTF-8"?>
<Example xmlns:TST="urn:xmlns:test.com:TST"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
       <Example.content>
             <TST:Simple>
                 <TST:SampleText>It is a test</TST:SampleText>
            </TST:Simple>
       </Example.content>
</Example>

I use castor to unmarshal this file and then to marshal with name
"example2.xml", but the
file "example2.xml" was created like this:

<?xml version="1.0" encoding="UTF-8"?>
<Example>
       <Example.content>
             <ns1:Simple xmlns:ns1="urn:xmlns:test.com:TST">
                 <ns1:SampleText>It is a test</ns1:SampleText>
            </ns1:Simple>
       </Example.content>
</Example>

I would like that the file "example2.xml" was created similar to the file
"exemplo1.xml".
In the place of  "ns1" I would like that there was "TST".

what I need to do?

Thanks.
Have you tried using Marshaller.setNamespaceMapping("TST", "urn:xmlns:test.com:TST") ?
That will certain add the namespace stuff to the root element. I don't know
what to do to make the element names appear qualified with the namespace prefix.

--
Andy Nguyen \ aqn at fortigo dot com \ (512) 305-0057

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev

Reply via email to