473,789 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extracting schema..

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
<xs:schema to </xs:schemainto xsd file and referencing it somehow?
don't know how to do that.

<NewDataSet>
<xs:schema id="NewDataSet " xmlns="" xmlns:xs="http://www.w3.org/2001/
XMLSchema" xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="u rn:schemas-microsoft-com:xml-msprop">
<xs:element name="NewDataSe t" msdata:IsDataSe t="true"
msdata:MainData Table="wg_Profi le" msdata:UseCurre ntLocale="true" >
<xs:complexType >
<xs:choice minOccurs="0" maxOccurs="unbo unded">
<xs:element name="wg_Profil e" msprop:Name="Pr ofile"
msprop:PK="Memb erID">
<xs:complexType >
<xs:sequence>
<xs:element name="DbName" type="xs:string "
minOccurs="0" />
<xs:element name="Name" type="xs:string "
minOccurs="0" />
<xs:element name="Type" type="xs:string "
minOccurs="0" />
<xs:element name="SubType" type="xs:string "
minOccurs="0" />
<xs:element name="Pos" type="xs:int" minOccurs="0" />
<xs:element name="Length" type="xs:int" default="0"
minOccurs="0" />
<xs:element name="Options" type="xs:string "
minOccurs="0" />
<xs:element name="OptionsDi rection" type="xs:string "
minOccurs="0" />
<xs:element name="InputType " type="xs:string "
minOccurs="0" />
<xs:element name="Display" type="xs:boolea n"
minOccurs="0" />
<xs:element name="Default" type="xs:string "
minOccurs="0" />
<xs:element name="Required" type="xs:boolea n"
minOccurs="0" />
<xs:element name="RequiredE rror" type="xs:boolea n"
minOccurs="0" />
<xs:element name="InvalidDa taError" type="xs:string "
minOccurs="0" />
<xs:element name="Group" type="xs:string "
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<wg_Profile>
<DbName>MemberI D</DbName>
</wg_Profile>
<wg_Profile>
<DbName>LastNam e</DbName>
</wg_Profile>
<wg_Profile>
<DbName>FirstNa me</DbName>
</wg_Profile>
<wg_Profile>
<DbName>Profile Name</DbName>
</wg_Profile>
<wg_Profile>
<DbName>Birthda y</DbName>
<Name>Birthda y MM/DD/YYYY</Name>
<SubType>Date </SubType>
<Display>true </Display>
<Default />
<Required>tru e</Required>
<InvalidDataErr or>Invalid Date MM/DD/YYYY</InvalidDataErro r>
</wg_Profile>
<wg_Profile>
<DbName>Gende r</DbName>
<Name>Gender</Name>
<Options>Male;F emale</Options>
<OptionsDirecti on>0</OptionsDirectio n>
<InputType>Radi oList</InputType>
<Display>true </Display>
<Default>Female </Default>
<Required>tru e</Required>
</wg_Profile>
<wg_Profile>
</NewDataSet>
Jun 27 '08 #1
1 1225
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.G etXmlSchema

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

My.Computer.Fil eSystem.WriteAl lText(My.Applic ation.Info.Dire ctoryPath & "\"
& classname & ".xml", xmloutput, False)

ShellandWait(My .Application.In fo.DirectoryPat h & "\xsd.exe", """" &
My.Application. Info.DirectoryP ath & "\" & classname & ".xml"" /c /l:vb /d",
My.Application. Info.DirectoryP ath)

My.Computer.Fil eSystem.CopyFil e(My.Applicatio n.Info.Director yPath & "\" &
classname & ".xml", outputdir & "\" & classname & ".xsd", True)

Hope that helps

John Sheppard

"mr t" <ta*****@gmail. comwrote in message
news:96******** *************** ***********@d1g 2000hsg.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
<xs:schema to </xs:schemainto xsd file and referencing it somehow?
don't know how to do that.

<NewDataSet>
<xs:schema id="NewDataSet " xmlns="" xmlns:xs="http://www.w3.org/2001/
XMLSchema" xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="u rn:schemas-microsoft-com:xml-msprop">
<xs:element name="NewDataSe t" msdata:IsDataSe t="true"
msdata:MainData Table="wg_Profi le" msdata:UseCurre ntLocale="true" >
<xs:complexType >
<xs:choice minOccurs="0" maxOccurs="unbo unded">
<xs:element name="wg_Profil e" msprop:Name="Pr ofile"
msprop:PK="Memb erID">
<xs:complexType >
<xs:sequence>
<xs:element name="DbName" type="xs:string "
minOccurs="0" />
<xs:element name="Name" type="xs:string "
minOccurs="0" />
<xs:element name="Type" type="xs:string "
minOccurs="0" />
<xs:element name="SubType" type="xs:string "
minOccurs="0" />
<xs:element name="Pos" type="xs:int" minOccurs="0" />
<xs:element name="Length" type="xs:int" default="0"
minOccurs="0" />
<xs:element name="Options" type="xs:string "
minOccurs="0" />
<xs:element name="OptionsDi rection" type="xs:string "
minOccurs="0" />
<xs:element name="InputType " type="xs:string "
minOccurs="0" />
<xs:element name="Display" type="xs:boolea n"
minOccurs="0" />
<xs:element name="Default" type="xs:string "
minOccurs="0" />
<xs:element name="Required" type="xs:boolea n"
minOccurs="0" />
<xs:element name="RequiredE rror" type="xs:boolea n"
minOccurs="0" />
<xs:element name="InvalidDa taError" type="xs:string "
minOccurs="0" />
<xs:element name="Group" type="xs:string "
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<wg_Profile>
<DbName>MemberI D</DbName>
</wg_Profile>
<wg_Profile>
<DbName>LastNam e</DbName>
</wg_Profile>
<wg_Profile>
<DbName>FirstNa me</DbName>
</wg_Profile>
<wg_Profile>
<DbName>Profile Name</DbName>
</wg_Profile>
<wg_Profile>
<DbName>Birthda y</DbName>
<Name>Birthda y MM/DD/YYYY</Name>
<SubType>Date </SubType>
<Display>true </Display>
<Default />
<Required>tru e</Required>
<InvalidDataErr or>Invalid Date MM/DD/YYYY</InvalidDataErro r>
</wg_Profile>
<wg_Profile>
<DbName>Gende r</DbName>
<Name>Gender</Name>
<Options>Male;F emale</Options>
<OptionsDirecti on>0</OptionsDirectio n>
<InputType>Radi oList</InputType>
<Display>true </Display>
<Default>Female </Default>
<Required>tru e</Required>
</wg_Profile>
<wg_Profile>
</NewDataSet>

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1208
by: Vika Zafrin | last post by:
Hello, group. I am working with some texts, literary and otherwise, marking them up as I go, without a set DTD. I do not plan to have a DTD in place at all, at least not for the encoding part of the exercise. What I would like is for oXygen (which I use on Mac OS X) to "remember" the elements, attributes and values I've used so far in this project. I tried using the "project" feature, but to no avail: I can create a schema, but the...
4
1602
by: Porthos | last post by:
Hi All, I've been working on mining data from a schema file (all attribute data so far) and have come to the point where I need to get information that is contained in tags. For instance, <tag>My Data Here</tag>. I've tried using the <xsl:value-of select="tag"/> element, but it does not appear to work in schema files. Is this correct? Is there another way to get at this data? -James
4
1467
by: Curious | last post by:
Hi, I have a class with properties and each property has specific datatypes. Is it possible to extract the datatypes of each property found in a class? I would like to extract these datatypes so that I can build a dataset schema structure at runtime.
1
1061
by: RSH | last post by:
Im trying to write a simple app that will show all of the user created tables along with their columns and column datatypes. Any suggestions on how to approach this??? Thanks!
7
2094
by: Amit | last post by:
Hi everybody,I have 2 dropdowns and on selected index change the second dropdown is populated accordingly and so on.i am displaying the selected value in a label for the user so that he comes to know the hierarchy level. i will show you this with a example so that u can understand it well and help me out to come with a solution.the scenario is as below: Label: a>>a1 Dropdown1:a,b,c,d Dropdown2:suppose user clicks on (a) item in the...
1
1409
by: annaannie | last post by:
hello sir, My aim is to extract 'id' and 'ac' from given XML files,and store the results in two different files.the code i wrote can extract 'ids',and give the output in a file.But i cant extract 'ac'.I want to extract all values of ac ,for eg ac="Q708T3",ie the output file should contain only Q708T3. Kindly provide a solution. The input file( ie XML ) is as follows: <?xml version="1.0" ?> - <EBIApplicationResult...
6
4455
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has some one experience with other libaries to
0
847
by: akshaychand | last post by:
Hi, I am designing a Schema Editor using the Schema Object Model in .NET 2.0. I am currently facing an problem wherein I want to list all the built-in data types as well as the custom types that are defined globally in the schema as well as the custom types that are defined globally in all the imported schemas. Basically, I want to list all these types in a drop down so that when user creates a new element or attribute, he can specify that...
2
1725
by: clawsicus | last post by:
Hi list, I'm trying to use regular expressions to help me quickly extract the contents of messages that my application will receive. I have worked out most of the regex but the last section of the message has me stumped. This is mostly because I want to pull the content out into regex groups that I can easily access later. I have a regex to extract the key/value pairs but it ends up with only the contents of the last key/value pair...
0
9506
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.