You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Serkan Taş <se...@hotmail.com> on 2010/06/09 09:10:39 UTC
Namespace prefix problem.
Hi,
I am facing with a problem of xml namspace prefix definition.
Question 1 :
I have got an xml below :
<xml-fragment>
<x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:role xsi:nil="true"
xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
</xml-fragment>
If i use XMLOptions and the methods like setSaveSuggestedPrefixes to replace
the prefixes, nothing changes.
Quesiton 2;
If i sent xml bean through Jmx, the resulting xml fragment changes :
On client side before sending :
<xml-fragment xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<x_:name/>
<x_:surname/>
<x_:role xsi:nil="true"/>
<x_:userName/>
</xml-fragment>
On the server side, received xml :
<xml-fragment>
<x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:role xsi:nil="true"
xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
</xml-fragment>
yours,
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
Re: Namespace prefix problem.
Posted by Serkan Taş <se...@hotmail.com>.
Question 1 or 2 ?
--------------------------------------------------
From: "Cezar Andrei" <ce...@oracle.com>
Sent: Wednesday, June 09, 2010 7:30 PM
To: <de...@xmlbeans.apache.org>; <xm...@xml.apache.org>
Subject: RE: Namespace prefix problem.
> Hi Serkan,
>
> Can paste the code that does the saving? Is it using the save method with
> the xmloptions parameter: XmlObject.save(outputstream|writer|file,
> XmlOptions) ?
>
> Cezar
>
> -----Original Message-----
> From: Serkan Taş [mailto:serkan_tas@hotmail.com]
> Sent: Wednesday, June 09, 2010 2:11 AM
> To: xmlbeans-dev@xml.apache.org
> Subject: Namespace prefix problem.
>
> Hi,
>
> I am facing with a problem of xml namspace prefix definition.
>
> Question 1 :
>
> I have got an xml below :
>
> <xml-fragment>
> <x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
> <x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
> <x_:role xsi:nil="true"
> xmlns:x_="http://www.hostname.com/XML_common_types"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> <x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
> </xml-fragment>
>
>
> If i use XMLOptions and the methods like setSaveSuggestedPrefixes to
> replace
> the prefixes, nothing changes.
>
>
> Quesiton 2;
>
> If i sent xml bean through Jmx, the resulting xml fragment changes :
>
> On client side before sending :
>
> <xml-fragment xmlns:x_="http://www.hostname.com/XML_common_types"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <x_:name/>
> <x_:surname/>
> <x_:role xsi:nil="true"/>
> <x_:userName/>
> </xml-fragment>
>
>
> On the server side, received xml :
>
> <xml-fragment>
> <x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
> <x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
> <x_:role xsi:nil="true"
> xmlns:x_="http://www.hostname.com/XML_common_types"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> <x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
> </xml-fragment>
>
> yours,
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
RE: Namespace prefix problem.
Posted by Cezar Andrei <ce...@oracle.com>.
Hi Serkan,
Can paste the code that does the saving? Is it using the save method with the xmloptions parameter: XmlObject.save(outputstream|writer|file, XmlOptions) ?
Cezar
-----Original Message-----
From: Serkan Taş [mailto:serkan_tas@hotmail.com]
Sent: Wednesday, June 09, 2010 2:11 AM
To: xmlbeans-dev@xml.apache.org
Subject: Namespace prefix problem.
Hi,
I am facing with a problem of xml namspace prefix definition.
Question 1 :
I have got an xml below :
<xml-fragment>
<x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:role xsi:nil="true"
xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
</xml-fragment>
If i use XMLOptions and the methods like setSaveSuggestedPrefixes to replace
the prefixes, nothing changes.
Quesiton 2;
If i sent xml bean through Jmx, the resulting xml fragment changes :
On client side before sending :
<xml-fragment xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<x_:name/>
<x_:surname/>
<x_:role xsi:nil="true"/>
<x_:userName/>
</xml-fragment>
On the server side, received xml :
<xml-fragment>
<x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:role xsi:nil="true"
xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
</xml-fragment>
yours,
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org