  | |  | extensible metadata schema | extensible metadata schema 2003-02-24 - By Bhasin, Vishal
Praveen, You can use XML-SPY to create a sample xml from a schema. You can use the following to validate an XML against a schema - xerces validation programmatically - XML-SPY Cheers, Vishal -----Original Message----- From: Praveen Peddi [mailto:ppeddi@(protected)] Sent: Monday, February 24, 2003 11:13 AM To: xerces-j-user@(protected) Subject: extensible metadata schema Hi all, I work for a company that does an asset metadata integration from different content management systems. We currently have an extensible schema where one can add/remove metadata fields in the schema on the fly. Now my problem is to take the input (mostly name value pairs) from any client and build the xml document which should be valid against the schema. Since the schema is fully extensible, the system doesn't know about it in advance. Now, my question is whats the best way to build the xml document from the input , that should be valid against the schema. Is there a better way where I can parse the schema and build the xml document based on that. Is there any API available to parse the schema and understand the schema attributes etc... Praveen
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft -com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http: //www.w3.org/TR/REC-html40">
<head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 9"> <meta name=Originator content="Microsoft Word 9"> <link rel=File-List href="cid:filelist.xml@(protected)"> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:DoNotRelyOnCSS/> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>0</w:Zoom> <w:DocumentKind>DocumentEmail</w:DocumentKind> <w:EnvelopeVis/> </w:WordDocument> </xml><![endif]--> <style> <!-- /* Font Definitions */ @(protected) {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0; mso-font-charset:2; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:0 268435456 0 0 -2147483648 0;} @(protected) {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:553679495 -2147483648 8 0 66047 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} span.EmailStyle15 {mso-style-type:personal-reply; mso-ansi-font-size:10.0pt; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:navy;} @(protected) Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @(protected) l0 {mso-list-id:2073191263; mso-list-type:hybrid; mso-list-template-ids:-915766400 51527032 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @(protected) l0:level1 {mso-level-start-at:0; mso-level-number-format:bullet; mso-level-text:-; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} ol {margin-bottom:0in;} ul {margin-bottom:0in;} --> </style> <!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1027"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--> </head>
<body bgcolor=white lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<p class=MsoNormal><span class=EmailStyle15><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'>Praveen,<o :p></o:p></span></font></span></p>
<p class=MsoNormal><span class=EmailStyle15><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=MsoNormal style='margin-left:.25in'><span class=EmailStyle15><font size=2 color=navy face=Arial><span style='font-size:10.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial'>You can use XML-SPY to create a sample xml from a schema. You can use the following to validate an XML against a schema<o:p></o:p ></span></font></span></p>
<p class=MsoNormal><span class=EmailStyle15><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1; tab-stops:list .5in'><![if !supportLists]><span class=EmailStyle15><font size=2 color=navy face="Times New Roman"><span style='font-size:10.0pt; mso-bidi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";mso-hansi -font-family: "Times New Roman";mso-bidi-font-family:"Times New Roman"'>-<font size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'> </span></font></span></font></span><![endif]><span class=EmailStyle15><font size=2 color=navy face=Arial><span style='font-size:10.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial'>xerces validation programmatically <o:p></o:p></span> </font></span></p>
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1; tab-stops:list .5in'><![if !supportLists]><span class=EmailStyle15><font size=2 color=navy face="Times New Roman"><span style='font-size:10.0pt; mso-bidi-font-size:12.0pt;mso-ascii-font-family:"Times New Roman";mso-hansi -font-family: "Times New Roman";mso-bidi-font-family:"Times New Roman"'>-<font size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'> </span></font></span></font></span><![endif]><span class=EmailStyle15><font size=2 color=navy face=Arial><span style='font-size:10.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial'>XML-SPY <o:p></o:p></span></font></span></p>
<p class=MsoNormal><span class=EmailStyle15><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=MsoNormal><span class=EmailStyle15><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'>Cheers,<o :p></o:p></span></font></span></p>
<p class=MsoNormal><span class=EmailStyle15><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=MsoNormal><span class=EmailStyle15><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'>Vishal<o:p ></o:p></span></font></span></p>
<p class=MsoNormal><span class=EmailStyle15><font size=2 color=navy face=Arial> <span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>---- -Original Message-----<br> <b><span style='font-weight:bold'>From:</span></b> Praveen Peddi [mailto:ppeddi@(protected)]<br> <b><span style='font-weight:bold'>Sent:</span></b> Monday, February 24, 2003 11:13 AM<br> <b><span style='font-weight:bold'>To:</span></b> xerces-j-user@(protected) <br> <b><span style='font-weight:bold'>Subject:</span></b> extensible metadata schema</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman" ><span style='font-size:12.0pt'><![if !supportEmptyParas]> <![endif]><o:p></o:p>< /span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>Hi all, </span></font><font color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p>< /span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>I work for a company that does an asset metadata integration from different content management systems. We currently have an extensible schema where one can add/remove metadata fields in the schema on the fly. Now my problem is to take the input (mostly name value pairs) from any client and build the xml document which should be valid against the schema. Since the schema is fully extensible, the system doesn't know about it in advance. </span></font><font color=black> <span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span> </font><font color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p>< /span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>Now, my question is whats the best way to build the xml document from the input, that should be valid against the schema. Is there a better way where I can parse the schema and build the xml document based on that.</span></font><font color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p>< /span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span> </font><font color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p>< /span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>Is there any API available to parse the schema and understand the schema attributes etc...</span></font><font color=black><span style='color:black; mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span> </font><font color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p>< /span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span> </font><font color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p>< /span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>Praveen </span></font><font color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p>< /span></font></p>
</div>
</body>
</html>
|
|
 |