Around and About .NET World

Il blog di Marco Minerva
posts - 1612, comments - 2154, trackbacks - 2144

My Links

News


Curriculum Vitae (ITA)

Curriculum Vitae (ENG)

Contattami su Live Messenger:


MCTS: Windows, Web, Distributed Applications & SQL Server

MCPD: Enterprise Applications

Tag Cloud

Archives

Post Categories

Links

Generare file XML a partire da uno schema XSD

Visual Studio fornisce un metodo molto semplice per "inferire" lo schema XSD di un file XML: basta aggiungere un Item al progetto e selezionare XML To Schema  per avviare un'apposita procedura guidata. In alcuni casi, però, potrebbe essere necessario fare anche il viceversa, ovvero costruire automaticamente un file XML che rispetti i vincoli definiti nel relativo XSD: può essere utile, ad esempio, quando si vogliono creare file XML di prova, conformi ad un certo formato, per eseguire una serie di test. In questo caso non ci sono strumenti già "confezionati". Su MSDN, però, è presente un articolo molto interessante, Generating XML Documents from XML Schemas, che illustra l'utilizzo di una piccola applicazione chiamata XmlSampleGenerator: essa prende in ingresso uno schema XSD e crea automaticamente un file XML che rispetta il suo formato.

Il codice (in C#) può essere scaricato da qui. E' stato creato con il .NET Framework 2.0 beta 1, ma si compila senza problemi anche utilizzando Visual Studio 2008.

Technorati Tag: ,,

Print | posted on giovedì 18 giugno 2009 12.28 | Filed Under [ C# VB .NET ]

Feedback

Gravatar

# re: Generare file XML a partire da uno schema XSD

Summer is approaching and sunglasses should be one of the most necessary accessories for a fashion woman. Coach sunglasses is a good choice for you. coach outlet stores offers great coach sunglasses, wonderful replica coach purses and

coach handbags. What is good is that all of them are very cheap. Why not own those fashionable issues and enjoy yourself in the

fantastic summer?
02/08/2010 5.55 | Gorgin
Comments have been closed on this topic.

Powered by: