Extracting schema..

Extracting schema..

am 17.04.2008 03:35:16 von tascien

The DataTable xml written out, produces the following xml. can anyone
show me how to extract that schema and put it in external file? the
reason for this, is that I want to apply that structure to multiple
different xml files and don't want to change the structure in each
file. thanks. I guess it would involve to putting the content from
into xsd file and referencing it somehow?
don't know how to do that.


xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
msdata:MainDataTable="wg_Profile" msdata:UseCurrentLocale="true">


msprop:PK="MemberID">


minOccurs="0" />
minOccurs="0" />
minOccurs="0" />
minOccurs="0" />

minOccurs="0" />
minOccurs="0" />
minOccurs="0" />
minOccurs="0" />
minOccurs="0" />
minOccurs="0" />
minOccurs="0" />
minOccurs="0" />
minOccurs="0" />
minOccurs="0" />








MemberID


LastName


FirstName


ProfileName


Birthday
Birthday MM/DD/YYYY
Date
true

true
Invalid Date MM/DD/YYYY


Gender
Gender
Male;Female
0
RadioList
true
Female
true


Re: Extracting schema..

am 18.04.2008 03:32:54 von Gabe Garza

You can use the xsd.exe file to convert an xml file into an xsd file...

Here is some VERY scrappy code I wrote to do it...it will write a dataset
schema to an xsd file...


Dim xmloutput As String

xmloutput = bigResultdata.GetXmlSchema

xmloutput = xmloutput.Replace(" encoding=""utf-16""?>", "?>")

My.Computer.FileSystem.WriteAllText(My.Application.Info.Dire ctoryPath & "\"
& classname & ".xml", xmloutput, False)

ShellandWait(My.Application.Info.DirectoryPath & "\xsd.exe", """" &
My.Application.Info.DirectoryPath & "\" & classname & ".xml"" /c /l:vb /d",
My.Application.Info.DirectoryPath)

My.Computer.FileSystem.CopyFile(My.Application.Info.Director yPath & "\" &
classname & ".xml", outputdir & "\" & classname & ".xsd", True)

Hope that helps

John Sheppard

"mr t" wrote in message
news:96d7c58c-c8a8-4d2d-ad34-944177483272@d1g2000hsg.googleg roups.com...
> The DataTable xml written out, produces the following xml. can anyone
> show me how to extract that schema and put it in external file? the
> reason for this, is that I want to apply that structure to multiple
> different xml files and don't want to change the structure in each
> file. thanks. I guess it would involve to putting the content from
> into xsd file and referencing it somehow?
> don't know how to do that.
>
>
> > xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
> > msdata:MainDataTable="wg_Profile" msdata:UseCurrentLocale="true">
>
>
> > msprop:PK="MemberID">
>
>
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
>
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
> > minOccurs="0" />
>

>

>

>

>

>

>

>
> MemberID
>

>
> LastName
>

>
> FirstName
>

>
> ProfileName
>

>
> Birthday
> Birthday MM/DD/YYYY
> Date
> true
>
> true
> Invalid Date MM/DD/YYYY
>

>
> Gender
> Gender
> Male;Female
> 0
> RadioList
> true
> Female
> true
>

>
>