Creating External Files
- About the directory structure.
- To create external files.
- To mark up sections to be emphasized in the text.
- To mark up sections to be omitted in the text.
- To create the Setup directory.
The WCWC (see footnote) Directory Structure
As an author of Webucator courses, you should start with a directory structure that looks like this:
Creating External Files
Any text files can be references from a lesson file. They just need to be marked up with the very simple Webucator Courseware XML language.
You should start by writing the Demo, Exercise, and Solution files in whatever tool and format you would normally use. After you have tested them and feel comfortable that all are working as they should, you should open them in an XML editor and mark them up so that they are valid according to the XML Schema shown below:
Code Sample: ExternalFiles/Demos/ExternalFile.xsd
<xs:schema xmlns="http://www.webucator.com/Schemas/Courseware" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.webucator.com/Schemas/Courseware" elementFormDefault="qualified">
<xs:element name="File">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Omit" type="xs:string"/>
<xs:element name="Em" type="xs:string"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
The first thing to do is to wrap the whole file in <cw:File> tags as shown below:
<cw:File xmlns:cw="http://www.webucator.com/Schemas/Courseware" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.webucator.com/Schemas/Courseware ../../../../../Authoring/ExternalFile.xsd"><![CDATA[Your code starts here. Notice how it bumps right against the beginning of the CDATA section Here's some more code. This code is what you want to emphasize in the manual. This is a lot of extra code that will remain in the file but should be omitted from the manual. This is the end of the file. Notice how it bumps right up against the close of the CDATA section.]]> </cw:File>
Things to notice:
- Namespace (see footnote): http://www.webucator.com/Schemas/Courseware - qualifier is "cw".
- The file must be well-formed XML. Because many code files include characters that will make the file poorly formed, you should always wrap all text in CDATA (see footnote) sections.
- ../../../../../Authoring/ExternalFile.xsd is a relative path to the schema, so that the file can easily be validated by any XML authoring tool.
Emphazing Content
To draw attention to content in the manual, wrap it in <cw:Em> tags as shown below:
<cw:File xmlns:cw="http://www.webucator.com/Schemas/Courseware" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.webucator.com/Schemas/Courseware ../../../../../Authoring/ExternalFile.xsd"><![CDATA[Your code starts here. Notice how it bumps right against the beginning of the CDATA section Here's some more code. ]]><cw:Em><![CDATA[This code is what you want to emphasize in the manual.]]></cw:Em><![CDATA[ This is a lot of extra code that will remain in the file but should be omitted from the manual. This is the end of the file. Notice how it bumps right up against the close of the CDATA section.]]> </cw:File>
Omitting Content
To omit content in the manual, wrap it in <cw:Omit> tags as shown below:
<cw:File xmlns:cw="http://www.webucator.com/Schemas/Courseware" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.webucator.com/Schemas/Courseware ../../../../../Authoring/ExternalFile.xsd"><![CDATA[Your code starts here. Notice how it bumps right against the beginning of the CDATA section Here's some more code. ]]><cw:Em><![CDATA[This code is what you want to emphasize in the manual.]]></cw:Em><![CDATA[]]><cw:Omit><![CDATA[ This is a lot of extra code that will remain in the file but should be omitted from the manual. ]]></cw:Omit><![CDATA[This is the end of the file. Notice how it bumps right up against the close of the CDATA section.]] </cw:File>
Files that Don't Get Validated
Files with the following extensions are copied as is to the output folder:
- gif
- jpg
- png
- mdb
- zip
- txt
- class
- dll
- pdb
- cache
- sln
- suo
All other files in the ClassFiles directory will be transformed, so they must be marked up as valid WCCW files.
Creating External Files Conclusion
In this lesson of the WCWC tutorial, you have learned to create and mark up external files. That's all there is to it.
Footnotes
-
Webucator CourseWare Creation system
-
CDATA is explained in Webucator's online XML tutorial.
-
Namespaces are covered in Webucator's online XML Schema tutorial.