Handling namespaces in xsd

"Parvatikar, Narayan" <[email protected]> Mon, 27 Jan 2014 12:36:35 +0000
Newsgroups gmane.text.xml.xmlbeans.user
Message-ID <d702a42d32a747399755995591949891@BY2PR03MB363.namprd03.prod.outlook.com>
--_000_d702a42d32a747399755995591949891BY2PR03MB363namprd03pro_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi

I am trying to convert a xml sample which has multiple namespaces using xml=
beans inst2xsd java API.
The generated xsd does not look correct?
Source XML :

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<abc xmlns:h=3D"http://www.w3.org/TR/html4/" xmlns:f=3D"http://www.w3school=
s.com/furniture" xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">
                <f:table>
                                <f:name>African Coffee Table</f:name>
                                <f:width>80</f:width>
                                <f:length>120</f:length>
                </f:table>
                <h:table>
                                <h:tr>
                                                <h:td>Apples</h:td>
                                                <h:td>Bananas</h:td>
                                </h:tr>
                </h:table>
</abc>

The generated XSD contains only f: table and does not produce element defin=
ition for root element abc.
Is there any way to handle the multiple namespaces in xmlbeans ?


Thanks
Narayan


--_000_d702a42d32a747399755995591949891BY2PR03MB363namprd03pro_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Mangal;
	panose-1:2 4 5 3 5 2 3 3 2 2;}
@font-face
	{font-family:Mangal;
	panose-1:2 4 5 3 5 2 3 3 2 2;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi <o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I am trying to convert a xml sample which has multip=
le namespaces using xmlbeans inst2xsd java API.<o:p></o:p></p>
<p class=3D"MsoNormal">The generated xsd does not look correct?&nbsp; <o:p>=
</o:p></p>
<p class=3D"MsoNormal">Source XML : <o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">&lt;?xml version=3D&quot;1.0&quot; encoding=3D&quot;=
UTF-8&quot;?&gt;<o:p></o:p></p>
<p class=3D"MsoNormal">&lt;abc xmlns:h=3D&quot;<a href=3D"http://www.w3.org=
/TR/html4/">http://www.w3.org/TR/html4/</a>&quot; xmlns:f=3D&quot;<a href=
=3D"http://www.w3schools.com/furniture">http://www.w3schools.com/furniture<=
/a>&quot; xmlns:xsi=3D&quot;<a href=3D"http://www.w3.org/2001/XMLSchema-ins=
tance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;&gt;<o:p></o:p></=
p>
<p class=3D"MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;f:table&gt;<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;f:name&gt;A=
frican Coffee Table&lt;/f:name&gt;<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;f:width&gt;=
80&lt;/f:width&gt;<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;f:length&gt=
;120&lt;/f:length&gt;<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp; &lt;h:td&gt;Bananas&lt;/h:td&gt;<o:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/h:tr&gt;<o=
:p></o:p></p>
<p class=3D"MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/h:table&gt;<o:p></o:p></p>
<p class=3D"MsoNormal">&lt;/abc&gt;<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">The generated XSD contains only <b>f: table</b> and =
does not produce element definition for root element
<b>abc</b>. <o:p></o:p></p>
<p class=3D"MsoNormal">Is there any way to handle the multiple namespaces i=
n xmlbeans ?
<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Thanks<o:p></o:p></p>
<p class=3D"MsoNormal">Narayan<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>

--_000_d702a42d32a747399755995591949891BY2PR03MB363namprd03pro_--