mirror of
https://github.com/SSCLI/sscli_20021101
synced 2026-06-08 12:28:57 +00:00
9fa3874800
Moved the original file to the archive subfolder.
102 lines
2.4 KiB
HTML
102 lines
2.4 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>XSD Schema Sample</title>
|
|
<link rel="stylesheet" type="text/css" href="../../../../docs/rotor.css">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
<h1> XSD Schema Sample</h1>
|
|
|
|
|
|
<h2>Sample Overview</h2>
|
|
|
|
|
|
<p>This sample illustrates how to read an XML Schema definition language (XSD)
|
|
file into the Schema Object Model (SOM). Then, the sample writes the XSD schema
|
|
that has been loaded into memory to a <b>XmdTextWriter</b> attached to the console for
|
|
display to the user.</p>
|
|
|
|
|
|
<p>This sample loads several example .XSD schema files into <b>XmlSchema</b> objects.
|
|
It then iterates over the object model to output a labeled form of the schema
|
|
to the console. The sample then uses the XSD Schema Object Model to create
|
|
an example XML file filled with generic content that matches the XSD schema. This demonstrates the power of the object model to generate and manipulate XML
|
|
that conforms to a schema.</p>
|
|
|
|
|
|
|
|
<h2>Sample Source and Build Output Locations</h2>
|
|
|
|
|
|
<p>The sample source is found in sscli\samples\howto\xml\xmlschema. </p>
|
|
|
|
|
|
<p>The source file is:</p>
|
|
|
|
|
|
<ul class="none">
|
|
<li><a href="xmlschema.cs">xmlschema.cs</a></li>
|
|
</ul>
|
|
|
|
|
|
<p>The build output location is %TARGETCOMPLUS%\samples\xml\xmlschema. The
|
|
output file is an executable assembly named xmlschema.exe.</p>
|
|
|
|
|
|
<p>The sample uses two XSD files:</p>
|
|
|
|
|
|
<ul class="none">
|
|
<li><a href="poschema.xsd">poschema.xsd</a></li>
|
|
<li><a href="books.xsd">books.xsd</a></li>
|
|
</ul>
|
|
|
|
|
|
<h2>Building the Sample</h2>
|
|
|
|
|
|
<p>All samples are built from the buildall script. </p>
|
|
|
|
|
|
<p>You can also build all the
|
|
samples by switching to the root of the sample directory, sscli\samples, and typing
|
|
<code>build -c</code>.</p>
|
|
|
|
|
|
<p>You can build this specific sample by switching to the sample directory and typing
|
|
<code>build -c</code>.</p>
|
|
|
|
|
|
<h2>Running the Sample</h2>
|
|
|
|
|
|
<p>These steps require that the Shared Source CLI (SSCLI) be already built and
|
|
functional.</p>
|
|
|
|
|
|
<ol>
|
|
<li>Run env.bat or source the env.csh or env.sh script files, depending on
|
|
your platform.</li>
|
|
<li>Switch to the %TARGETCOMPLUS%\samples\xml\xmlschema directory.</li>
|
|
<li>Type the following command:<blockquote>
|
|
|
|
|
|
<p>clix xmlschema.exe</p>
|
|
|
|
|
|
</blockquote>
|
|
|
|
|
|
</li>
|
|
</ol>
|
|
|
|
|
|
<hr>
|
|
|
|
|
|
<p><i>Copyright (c) 2002 Microsoft Corporation. All rights reserved.</i></p>
|
|
</body>
|
|
</html> |