all groups > dotnet xml > march 2005 >
You're in the

dotnet xml

group:

XSD - How to create a default XML


XSD - How to create a default XML Stefano
3/21/2005 9:40:08 AM
dotnet 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


Re: XSD - How to create a default XML Martin Honnen
3/21/2005 12:57:19 PM


[quoted text, click to view]


[quoted text, click to view]

..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+from+XML+schema&btnG=Search>
maybe you can find something useful there.

--

Martin Honnen
Re: XSD - How to create a default XML Stefano
3/21/2005 2:47:48 PM
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" <mahotrash@yahoo.de> ha scritto nel messaggio
news:O%23Qzo0gLFHA.436@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]
<http://www.google.com/search?hl=en&lr=&c2coff=1&q=generate+sample+XML+from+
XML+schema&btnG=Search>
[quoted text, click to view]

Re: XSD - How to create a default XML Martin Honnen
3/21/2005 3:38:54 PM


[quoted text, click to view]


[quoted text, click to view]

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#9fec532900467890>

--

Martin Honnen
Re: XSD - How to create a default XML Stefano
3/21/2005 4:13:46 PM
OK, thanks!

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

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


"Martin Honnen" <mahotrash@yahoo.de> ha scritto nel messaggio
news:Ofdi2OiLFHA.2764@tk2msftngp13.phx.gbl...
[quoted text, click to view]
<http://groups-beta.google.com/group/microsoft.public.dotnet.xml/browse_frm/
thread/238aba965f4a5f7c/9fec532900467890?q=create+XML+document+from+schema+g
roup:microsoft.public.dotnet.xml#9fec532900467890>
[quoted text, click to view]

Re: XSD - How to create a default XML Martin Honnen
3/21/2005 5:26:18 PM


[quoted text, click to view]

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
Re: XSD - How to create a default XML Stefano
3/21/2005 5:39:27 PM
OK, thank you again!

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


"Martin Honnen" <mahotrash@yahoo.de> ha scritto nel messaggio
news:eDCg3KjLFHA.2252@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button