473,414 Members | 1,776 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

XSD - How to create a default XML

Hi all,

I defined a XML Schema... so I've a .xsd file.

I defined the schema using "default" attribute... for example:
<xs:element name="color" type="xs:string" default="red"/>

Now, I would like to generate an empty XML file, from the XML Schema.

How can I do that?

Thanks a lot.

Bye
--
Stefano Giannone
MCP .NET
http://www.giasoft.it

Nov 12 '05 #1
6 1565


Stefano wrote:

I defined a XML Schema... so I've a .xsd file.

I defined the schema using "default" attribute... for example:
<xs:element name="color" type="xs:string" default="red"/>

Now, I would like to generate an empty XML file, from the XML Schema.


..NET 1.x and its xsd.exe tool has support to generate an XML schema from
an XML instance document but not the other way round.
But there are some XML editors around that claim they support generating
a sample XML from a DTD or schema.
And Google turns up some stuff
<http://www.google.com/search?hl=en&lr=&c2coff=1&q=generate+sample+XML+fr om+XML+schema&btnG=Search>
maybe you can find something useful there.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #2
Hi Martin,

thanks for the answer.

I need to do that programmatically, both from JavaScript (client side) and
ASP.NET (so .NET 1.x... server side).

Any ideas?

Thanks!

Bye
--
Stefano Giannone
MCP .NET
http://www.giasoft.it
"Martin Honnen" <ma*******@yahoo.de> ha scritto nel messaggio
news:O%***************@TK2MSFTNGP09.phx.gbl...


Stefano wrote:

I defined a XML Schema... so I've a .xsd file.

I defined the schema using "default" attribute... for example:
<xs:element name="color" type="xs:string" default="red"/>

Now, I would like to generate an empty XML file, from the XML Schema.
.NET 1.x and its xsd.exe tool has support to generate an XML schema from
an XML instance document but not the other way round.
But there are some XML editors around that claim they support generating
a sample XML from a DTD or schema.
And Google turns up some stuff

<http://www.google.com/search?hl=en&l...mple+XML+from+
XML+schema&btnG=Search> maybe you can find something useful there.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #3


Stefano wrote:

I need to do that programmatically, both from JavaScript (client side) and
ASP.NET (so .NET 1.x... server side).


There are some examples around, at least for .NET using the SOM (schema
object model), the most promising earlier thread I can find on that is here:
<http://groups-beta.google.com/group/microsoft.public.dotnet.xml/browse_frm/thread/238aba965f4a5f7c/9fec532900467890?q=create+XML+document+from+schema +group:microsoft.public.dotnet.xml#9fec53290046789 0>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #4
OK, thanks!

Maybe OT... but... what about JavaScript side?

Bye
--
Stefano Giannone
MCP .NET
http://www.giasoft.it
"Martin Honnen" <ma*******@yahoo.de> ha scritto nel messaggio
news:Of**************@tk2msftngp13.phx.gbl...


Stefano wrote:

I need to do that programmatically, both from JavaScript (client side) and ASP.NET (so .NET 1.x... server side).
There are some examples around, at least for .NET using the SOM (schema
object model), the most promising earlier thread I can find on that is

here: <http://groups-beta.google.com/group/...ml/browse_frm/
thread/238aba965f4a5f7c/9fec532900467890?q=create+XML+document+from+schema +g
roup:microsoft.public.dotnet.xml#9fec532900467890>
--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #5


Stefano wrote:
what about JavaScript side?


MSXML 4 has support for a SOM (schema object model) too thus if you
script MSXML 4 with J(ava)Script you could in theory walk the SOM of a
schema and try to generate an XML instance. I don't know of code
examples doing that however.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #6
OK, thank you again!

Bye
--
Stefano Giannone
MCP .NET
http://www.giasoft.it
"Martin Honnen" <ma*******@yahoo.de> ha scritto nel messaggio
news:eD**************@TK2MSFTNGP15.phx.gbl...


Stefano wrote:
what about JavaScript side?


MSXML 4 has support for a SOM (schema object model) too thus if you
script MSXML 4 with J(ava)Script you could in theory walk the SOM of a
schema and try to generate an XML instance. I don't know of code
examples doing that however.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #7

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

Similar topics

4
by: Phil Powell | last post by:
create table if not exists nnet_produkt_varegruppe ( nnet_produkt_varegruppe_id int not null auto_increment, primary key(nnet_produkt_varegruppe_id), nnet_produkt_varegruppe_navn varchar(255) not...
5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
3
by: J West | last post by:
Warning: Error while executing this query:CREATE TABLE "purchaseorder" ( "PurchaseOrderID" int(10) unsigned NOT NULL auto_increment, "PurchaseCost" double unsigned zerofill NOT NULL default...
9
by: expect | last post by:
Hello, Trying to get this MySql create table command to work, no luck. create sequence serial; CREATE TABLE outbound ( source char(100) default '', destination char(100) default '', sport...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
2
by: Pranab | last post by:
On my local sandbox , in IIS I created some Websites . Now when I try to create a ASP.NET web application , it tries to create it in the website last created and fails . But my requirement is...
2
by: pankaj_wolfhunter | last post by:
Greetings, In sybase there is a create default statement in order to create a default object. like CREATE DEFAULT one as 1 go this object then can be bound to different table columns as...
5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
3
by: zufie | last post by:
I want to use SQL code to Create a Table & Provide a Default Value for Each Column. Here is the code I am using: CREATE TABLE customer (First_Name char(50), Last_Name char(50), Address...
3
by: ScorpAL | last post by:
Hi, I have some problem... I have two tables phpbb_posts and phpbb_posts_new with same fields and structure: CREATE TABLE `phpbb_posts` ( `post_id` mediumint(8) unsigned NOT NULL...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.