ScriptWorx.NET Help

Welcome to the ScriptWorx.NET Help Center, your resource for help, tutorials and pointers when using ScriptWorx.NET.

This is a beta copy, which means not all the topics in the help center are complete, or are already present in the help center.


Code Controller

Task Panels and the Code Controller have been merged to provide comprehensive access to appropriate tasks - you now have instant access to dozens of features. Commonly used tasks are given priority on each panel - try clicking the small downward pointing arrow at the top of the panel, which will load the panel you want.

New Document, Objects, Events and Symbols are unchanged from previous versions, but there are several new panels available to choose from:

Thumbnails
Clipboard
Tidy
Database
Search

You'll find that rather than cramming features in, the panels are clearly usable: simple options, friendly layouts and no interfering flashes or noises!


The Clipboard Panel

The Clipboard Panel keeps a constant monitor on your PC's clipboard, the panel holds as much information as it can store in memory at any given time. Every time you cut or copy text to the clipboard, it appears as a "button" within the panel - just double click it to add the text to your active document. If you wish to clear the panel, please click the "Delete" button at the top.


The Database Panel

If you've used the Database Connection Wizards in ScriptWorx, you'll find the Database Panel a real asset. You can choose to either create a new connection or use an existing one, both can be selected at any time. When you've made a connection, the fields list from the table you selected will populate. Click on any field name and choose an option, depending on your server-side application server. You can insert fields using Active Server Pages.


The Search Panel

If you need to find and replace something in your current document, but don't want to deal with multiple popup windows, try the new Search Panel. You can find and replace text in your current document, and choose from the most commonly used Search and Replace options.


The Thumbnails Panel

Using the Thumbnails Panel can load an entire directory of images, preview them a small "thumbnails" in a list and allows you to add the image to your document. First click the "Click here to change directory" and choose a directory on your computer with images, then click the "OK" button. When all the images are loaded, you may scroll through the list or double-click an entry to insert it into your current document.


The Tidy Panel

The Tidy panel eliminates the need to use the main and complex Tidy dialog, but you can still use it if necessary. This panel holds the most commonly used Tidy actions, including the new "Convert to slide show" option. To tidy your document, check off the list of options, and then press the "Tidy" button. This should take seconds to work on your document - if it takes longer, please try repairing your installation.


The Editor

Every time that a file is created or opened in ScriptWorx, the Editor is invoked to edit that file. As with all HTML editors, ScriptWorx color-codes your code, but ScriptWorx can also support highlighting for Pascal, Visual BASIC, C++, C#, Perl and more.

The gutter is usually present on the left side of the editor, which can show line numbers or bookmarked lines. The margin is a thin line on the right side of the editor, which shows the point at which text wraps or will display where text should be wrapped to improve readability.

Furthermore, the editor can have several options set, including:

Option | Description
Auto Indent | Indents new lines at the same position of previous lines.
Smart Tabs | Tabs on new lines match tab positions of previous lines.
Group Undo | Undo many commands with one click.
Highlight URL's | Highlights URL's and each URL can be clicked to launch the appropriate location.
Cursor Past EOF/EOL | Allows you to move the cursor past the final line in a document (EOL) or beyond the end of a line (EOF).


Validate Code Online

ScriptWorx can automatically upload files to the Web Design Group's highly acclaimed online validation services, which can check both HTML and CSS documents. Selecting either option (from HTML or CSS) transfers the code, allows the server to process it with the results being displayed onscreen for you.

How do I do this?

Tools Menu: Validate Online


Menus and Toolbars

Each toolbar in ScriptWorx can be dragged and dropped using the small, dotted line at the top or left corner of the toolbar (see figure 1). There are dock areas on all four sides of the window to allow you to organize your toolbars.

To switch a toolbar off (including the Code Controller), right-click it and click on the name of the toolbar you would like to remove. If you removed this toolbar by mistake, you can retrieve it by right-clicking on any other toolbar and select the missing toolbar again to show it.

Toolbars and menus can be customized, on the premise that commands can be dragged, dropped or removed from a toolbar. There are two methods of performing this.

Quick Customize

Look at the right-most part of a toolbar for a small, downward facing arrow. Click this using you left mouse button, and you will see a list of commands available for the toolbar you are customizing. Click each command to switch it on or off (see figure 2)

Fully Customize

Right-click on any toolbar, and choose the "Customize" option from the menu. You will now see a window with several tabs in it, you must click the "Commands" tab:

oChoose a command category from the list.
oFind the command you want from the "Commands" list.
oDrag and drop the command onto any toolbar or menu (press and hold down your left mouse button whilst dragging).
oClick the "Close" button.


Keystrokes

Each menu and toolbar item can be accessed using a combination of keys on the keyboard, each of which can be reassigned (except for some special functions which don't accept keystrokes).

How do I do this?

Edit Menu: Preferences: Keystrokes


Editor Options

The editor can have the following settings adjusted:

Option | Description
Gutter | Displays a left-side margin in the editor for bookmarking and line number indicators.
Margin | Displays a narrow line on the far-right side of the page, which indicates the point at which word wrap occurs.
Hidden Symbols | Toggles the display of formatting marks such as indents, paragraph markers and returns.
Word-wrap | Causes text to cut to the next line when it cannot be shown entirely on one line.
Line Numbers | Keeps a list of line numbers within the gutter.
Hyperlinks | Converts hyperlinks into actual, working hyperlinks.
Backspace Unindent | Deletes an indent completely when the "Delete" key is pressed.
Auto Indent | New lines will be indented at the same level as the line before.
Smart Tabs | Tabs on a line will occur on the same place as the previous line.
Group Undo | Causes many actions to be undone at once.
Cursor Past EOF/EOL | EOF determines if the cursor can be placed after the last character of a line. EOL determines if the cursor can move beyond the end of a document.
Double-click Line | Allows you to select an entire line of text by double-clicking it.

How do I do this?

Edit Menu: Preferences


Timed Backup

If enabled, Timed Backup creates a copy of the documents you are working based upon a time interval of your choice. This can be between one minute and twenty minutes, we recommend between four and five minutes.

The backup is placed in the same directory as the file you are working on, but it will have a .bak extension to the file, which you can delete using Windows Explorer.

How do I do this?

Edit Menu: Preferences -> Timed Backup


Customizing Spell Checking

There are many ways in which you may customize the spell checker to your satisfaction, such as ignoring HTML tags and words with numbers. The easiest way is to open the "Preferences" window and choosing "Spelling" from the list.

Ignore HTML and XML Tags Select this option to prevent tags from being checked (recommended).

Ignore Internet Addresses Prevents the spell check engine from reporting addresses like http://www.softlite.net and so on.

Ignore All Uppercase Set this to prevent the spell checker from highlighting words in uppercase, something which is quite common in HTML and XML documents.

Ignore Abbreviations By default, the dictionary does not contain any abbreviations, such as degrees (eg. MSc etc.) or stock market ticker symbols, which will be ignored by the spell check if this option is set to true.

Ignore Quoted Lines This option may be used to prevent quote material from being checked by the spell checker, particularly if you are quoting in another language.

Ignore Words Containing Numbers Ignore any words which contain numeric entities.

Suggest from Main Dictionaries Only Choose this option if you believe your personal dictionary may not have all the words you have in the main dictionary.

Prompt on Repeated If you've accidentally repeated a word, you will be prompted when the spell checker encounters such an error.

How do I do this?

Edit Menu: Preferences: Spell Checking


TagTemplates

TagTemplates are each composed of three sections:

oA keyword.
oA description.
oThe code.

Keywords - if you type a keyword into your document, then press [Ctrl] + [J] - the TagTemplate will add the related code into your document.

Alternatively, you can press [Ctrl] + [J] and then choose from a list of descriptions to insert your code. A keyword should be unique, whilst the code for one TagTemplate may be identical to that of another.

How do I do this?

Edit Menu: Preferences -> Code Insight

Under the TagTemplates section, choose from "Add", "Edit" or "Delete" to modify and manage TagTemplates.


TagInsight

Pressing '<' whilst editing an HTML or XML-based document provides a drop-down list of tags, from which a tag or pair of tags can be selected without having to type more than a few keys at once.

How do I do this?

Edit Menu: Preferences -> Code Insight

Under the TagInsight section, choose from "Add", "Edit" or "Delete" to modify and manage tags held in the list.


Programs and Browsers

ScriptWorx lets you specify an unlimited number of web browsers for previewing, such as Internet Explorer, Netscape Navigator or Opera. To add, amend or delete these, open the Preferences window and then click on "Programs".

How do I do this?

oTo add a browser, click the add button and search for the filename of the browser.
oTo edit a browser configuration, click the edit button.
oYou can delete a browser by selecting it and then pressing the "Delete" button.


Create a New Document

To create an HTML file with only the bare minimum of tags, but without any visible elements, use the "New" file option.

How do I do this?

File Menu: New


New from Template

The Templates command can create new files or new solutions (projects) for files to be organised within. ScriptWorx is accompanied by several basic templates with the most common web page layouts, usually produced using HTML tables but frames pages are also available to use.

How do I do this?

File Menu: New from Template


Open a (Local) File

Local documents are basically files that reside on your computer's hard disk, or even across a Local Area Network. This is where you should open most of your files, as it is not always necessary to use the Internet to retrieve files.

Files of different types can be filtered using the "Filter" option, which by default is set to Web files (such as HTML). Depending on the type of file you open, ScriptWorx automatically selects the most appropriate syntax highlighter for that file. However, you may select a different highlighter once the document is open.

How do I do this?

File Menu: Open from Local


Open a (Remote) File

If you don't actually have the source code to a web page on your hard disk or network, you can directly poll pages from the web into ScriptWorx using "Open from Web". Please note that this feature does not yet retrieve any images or stylesheets external to the document you are downloading.

oEnter a URL or location to open (eg. http://www.softlite.net).
oChoose a filename to save the URL to on your computer.
oYou can use "Set Browser Name" to disguise ScriptWorx as a browser (ie Internet Explorer, Netscape, Opera or Lynx) so that pages that redirect you will be the pages you want to see.

The "Open" button features a small drop-down menu represented by an arrow. You can choose to open the URL without using a proxy server (as you would do by simply clicking "Open") or you can choose to route your request through a proxy server.

How do I do this?

File Menu: Open from Remote


Import from Excel or CSV

If you wish to import Excel or CSV files directly into the editor, choose the "Import" option from the main "File" menu. If you select CSV, then you will firstly need to specify a delimiter from the list, or ScriptWorx will try to analyze the document and make an educated selection.

The direct import dialogs also allow you to specify table formatting options, such as cell spacing, padding and table width.

How do I do this?

File Menu: Import from...


Import from Word HTML

Microsoft Word 2000 generates unnecessary information within most of the HTML documents that it generates. Not only is this a pointless coding practice, it can increase the loading time of your document.

It is feasible that some of the HTML generated will not work in all browsers, so we recommend running the "Fix Word 2000 HTML" option for all files generated using Microsoft Word.

How do I do this?

File Menu: Import: Word HTML


Export Code

If you wish to save your HTML code to demonstrate it visually, say in a Word document or on a web page, ScriptWorx can produce a highlighted copy of your code. For example, we've just designed a new page, but wish to show a visitor at our site the code, ScriptWorx can produce a page using the same colors as the current syntax highlighter.

You may export documents like this to HTML or Rich Text Format to open in your word processing software.

How do I do this?

File Menu: Export As


Preview Documents

You can use an external browser (an unlimited number) to preview your pages. Simply go to the "Tools" menu, select "Preview" and choose the browser you wish to use. For details on how to add or remove browsers, see below.

How do I do this?

oOpen the "Preferences" window from the "Edit" menu.
oClick on the "Programs" option is the list on the left.
oChoose "Auto-Configure" to allow ScriptWorx to find Internet Explorer, Netscape Navigator, Netscape 6, Opera and Lynx.
oAlternatively you can add browsers manually.
oClick the "Add" button and use the dialog to browse for your Browser's executable.
oWhen the browser has been added, choose "Rename" browser to set the name of the browser. Repeat as needed.
oClick the "OK" button to update your browser options.


Converting Text Between Cases

The actions menu provides several case conversion options, based upon entire lines or selected blocks of text. This can be performed by converting to either uppercase or lowercase.

How do I do this?

Actions Menu: Convert Case


Finding and Replacing Text

Finding and replacing text in ScriptWorx is very easy. However, there are many options which you may not have encountered before.

Find Dialog

A log of all your searches is kept for easy access in the future, which you can see next to "Text to Find".

Case sensitivity ensures only matches with the same case you have used are shown, whilst whole words allows only the exact form of words you have used.

Directions can be used to search the text before the cursor point (backwards) or the point after it (forwards).

The scope of your search can either include the entire document, or simply text that you have selected using the mouse or cursor.

The origin performs a similar purpose, but only affects the options you set in scope.

Find and Replace Dialog

The Replace dialog is very similar to the "Find" option, but has an extra field for text to replace any matches found. This also maintains a separate log for future use. You can select "Prompt on Replace" to confirm if ScriptWorx should replace any text that is found.

How do I do this?

Search Menu


Multiple File Find/Replace

To find and replace text in more than one file, you will have to use the "Extended Find and Replace" feature. This also has the same "Find" and "Replace" options, but you must must select files first.

oClick on the "Select" button.
oUse the dialog to jump to the directory you want.
oClick each file you want whilst holding down the "Shift" key and click the "Open" button.

How do I do this?

Search Menu: Extended Find and Replace


Block Indenting Code

If you do not have Smart Tabs and Auto Indent switched on, you may still wish to indent large blocks of code rather than indenting only one line of code at a time. To accomplish this, select a block of text using the mouse or cursor keys, followed by executing the commands above.

How do I do this?

Actions Menu:: Code Formatting: Indent/Outdent


Bookmarking Code

ScriptWorx allows you to specify ten bookmarks per document, which can be set at important lines in large files for easy navigation. Bookmark numbers are indicated in the gutter wherever a bookmark is located.

You may set and jump to bookmarks using the commands above, excluding [0-9] and replacing it with any number between 0 and 9.

How do I do this?

Set Bookmark [0-9] - Ctrl + Shift + [0-9]
Get Bookmark [0-9] - Ctrl + [0-9]


Jump to Top/Bottom

These commands will take you to the top and bottom most lines of a document respectively.

How do I do this?

Search Menu: Jump to Top/Bottom


Jump to Lines

To jump to any existing line in your document, use the "Go To Line" feature to move the cursor there. If you would like to make a note of important lines, please try bookmarking it too.

How do I do this?

Search Menu: Jump to Line


Printing a Document

If you need a copy of your work on paper, or if you can spool to a PDF driver and so on, you can select from various options in ScriptWorx for this purpose. You have two methods of printing:

oOnly selected text or, othe entire document.

If you have selected text within your document, you can toggle this option on or off. However, if no text is selected, you will be forced to print the entire document.

Option | Description
Header | Displays the current filename and page number at the top of every page.
Line Numbers | Will print line numbers in a narrow margin on the left side of the page.
Syntax Print | Ensures tags are color coded or printed in different shades of grey.
Use Color | Enforce tags to be printed in color.
Wrap Lines | Prevents lines from trailing off the edge of the page.
Left Margin | The margin to leave on the left side of the page (in columns).
Show Progress | Shows the progress of the print job.

How do I do this?

File Menu: Pritn...


Switching Between Documents

Rather than organizing documents into tabs, you can have multiple files displayed simultaneously in ScriptWorx. This can be performed using the "Tile" option from the Window Menu. Cascade displays all open documents in a cascaded list, where documents appear in "stacks".

Next and Previous are used to jump between all open editing windows.

How do I do this?

Windows Menu - Various


Choosing Web-Friendly Colors

A common problem encountered by web developers is the manner in which colors appear on different computers. Even the hue of monitors can differ between a PC and an Apple Mac, but there is a common solution to this problem.

Websafe colors are hexadecimal representations of colors, which are slightly more accurate than named colors.

Suppose you want the hexadecimal version of black, which is: #000000, the string is composed from hexadecimal values for the red, green and blue colors which make up a real color:

Red | Green | Blue
00 | 00 | 00

How do I do this?

You don't have to remember all these hexadecimal representations, because ScriptWorx does this for you. By choosing the web-safe color guide from the "Formatting" toolbar and selecting a color, you have the appropriate code inserted instantly.


Spell Checking

To spell check your document, choose the "Spell Check" menu option to begin checking. You can select a replacement from the "Suggestions" box (if available) or choose to ignore the instance of a word once or throughout your document, or you can also add the word to your personal dictionary.

How do I do this?

Tools Menu: Spell Check


HTML Tidy

HTML Tidy is the code cleaning tool of choice for countless HTML developers. This small program (integrated with ScriptWorx) can apply source formatting, fix poorly coded pages or convert a page to the latest standards. The HTML Tidy interface has several options, which are covered in this help section.

- Character Encoding Determines how Tidy interprets character streams. For ascii, Tidy will accept Latin-1 character values, but will use entities for all characters whose value > 127. For raw, Tidy will output values above 127 without translating them into entities. For latin1 characters above 255 will be written as entities. For utf8, Tidy assumes that both input and output is encoded as UTF-8. You can use iso2022 for files encoded using the ISO2022 family of encodings e.g. ISO 2022-JP. The default is ascii.

- Wrap Sets the position at which lines of code will be wrapped (in columns).

- Indent This is used in source formatting to specify the number of columns to indent code.

- Default "Alt" Tag Specifies the "alt" text that should be applied to any image without an "alt" attribute.

- Doc Type DocType Use the "Doctype" option to tell HTML Tidy whether to use the strict, loose (transitional) or automatic HTML DTD. We recommend automatic for most purpose.

How do I do this?

Tidy Menu: Fix and Format HTML


Convert to CSS

ScriptWorx allows you to upgrade formatting markup in your document to Cascading Style Sheets, as recommended by the World Wide Web Consortium. This replaces <font> tags with global document <style> tags to reduce repetitive coding and give pages a uniform appearance.

How do I do this?

Tidy Menu: Convert to CSS


Convert to XML

XML is an extensible markup language, which can use user-defined tags, and has many different uses. Quite often this is for data access and retrieval. ScriptWorx will upgrade your document to XML 1.0 with all the appropriate markup you require.

How do I do this?

Tidy Menu: Convert to XML


Convert to XHTML

XHTML is the successor to the popular HTML 4.0. This standard is being ratified by the World Wide Web Consortium, who have a site dedicated to XHTML. ScriptWorx will upgrade your document to XHTML 1.0 with all the appropriate markup you require.

How do I do this?

Tidy Menu: Convert to XHTML


Validate Online

ScriptWorx can automatically upload files to the Web Design Group's highly acclaimed online validation services, which can check both HTML and CSS documents. Selecting either option (from HTML or CSS) transfers the code, allows the server to process it with the results being displayed onscreen for you.

How do I do this?

Tidy Menu: Online Validators


Validating Links

Designing a good website relies on links between pages being correct, be they on a hard disk or being served via a web-server, links should be correct. ScriptWorx will check links for you, using the "Link Validator".

oOpen a document and save it. Launch the "Link Validator".
oChoose the types of tags you wish to check, which can be selected from the "Tags to Check" list.
oClick "Check". The process may take some time depending on the size of your document, but it should not take too long for most files. When a list of invalid links appear, you are given an error message which ScriptWorx received when trying to access a bad link. To jump to a link within your document, simply double-click it with your mouse from the list.

How do I do this?

Tidy Menu: Validators: Link Validator


Introduction to JavaScript

JavaScript is a scripted programming language which is used in HTML to create document effects and other specialized tasks. You can use JavaScript to validate forms, redirect users or perform mathematical calculations. Contrary to popular belief, JavaScript is not the same as Java!

The following indicates the level of support by Netscape Navigator of JavaScript:

JavaScript Version | Netscape Version
1.0 | 2.0
1.1 | 3.0
1.2 | 4.0-4.05
1.3 | 4.06-4.5+

Internet Explorer supports most of the features of JavaScript too, so scripts may need some alterations between the two browsers. However, all code generated by ScriptWorx is tested as much as possible on different browsers.


Object and Function Insight

Function Insight provides in-line tooltip information on information to be passed when editing in VB.NET mode, making it easier to pass the correct parameter to the function, without generating errors.

Object Insight provides in-line, scrollable lists of methods and properties appropriate to the script object preceeding the '.' symbol.


Adding Scripts

Inserting JavaScript code into your document is easy, you can either code it manually (read this) or use the ScriptWorx tools. By opening the JavaScript tool, you can specify the following options.

Language: The scripting language you wish to use, which doesn't necessarily have to be JavaScript. This will affect the way a web browser displays your code. (Warning - Netscape and Opera do not support VBScript on the client-side).

MIME Type: This is optional but can affect the way a web browser handles scripts stored in a separate file.

Source: Specifies the name of the file in which code can be found as an alternative, with JavaScript files normally having a .js extension.

NOSCRIPT Message: A message which users with a browser incapable of using JavaScript or users who have disable JavaScript will see as an alternative.

The code editor is located at the bottom of the JavaScript tool, which supports both Function and Object Insight for JavaScript. When you are ready to add your code to your document, simply click "OK".

How do I do this?

Insert Menu: JavaScript


Object Explorer

The Object Explorer classifies subroutines in VB.NET/C# documents according to private, public and exported properties. Clicking on an object or subroutine name automatically places the cursor where the object is declared, without having to use the "Find" command.


Creating an Image Map

An Image Map defines certain sections of an image which can be used to link to many different pages. This is useful if you want a user to click a particular part of a web page, but this used to be a difficult task with text editors - ScriptWorx has stopped that.

oOpen the Visual Image Map Creator
oClick the "Open" button and select your image.
oEnter a unique name for your image map in the "Name" field.
oUsing the two shape tools (ellipse or rectangle) click the appropriate button and enter a link when prompted.
oResize the map areas as required, this can be perform by dragging the borders of an area.
oTo move any map area, left-click and hold the mouse down whilst dragging the shape.
oClick the "OK" button to add your Image Map to your document.

How do I do this?

Tools Menu: Visual Image Map Creator


Creating a Hyperlink

The hyperlink is the HTML component that allows your visitor to move from one page to another, all with the click of a mouse. Hyperlinks are also examined in the HTML Reference guide supplied with ScriptWorx.

Link To: This specifies the URL of the page you wish to move to. This can take the form of http://myname/document.htm or it can be /directory/document.htm. You can also use links to e-mail addresses, newsgroups, resources and secure pages.

Target: In a frames-based site, this tells the browser the name of the frame to display the page in. It can also define if the hyperlink will open in a new window (_blank) or this default can be left blank.

Style: This is an example of in-line style sheets. You can specify any CSS values here of the format:

body-background: #ffffff; font-family: Verdana, Arial;

Name: This can be used to assign a name to a hyperlink object, which can be useful when combined with JavaScript.

Class: If a style-sheet class has been defined by a pair of <style></style> tags or in an external stylesheet, the formatting of the class can be applied to the hyperlink by using this option.

How do I do this?

Tools Menu: Visual Image Map Creator


Creating a Hyperlink

The hyperlink is the HTML component that allows your visitor to move from one page to another, all with the click of a mouse. Hyperlinks are also examined in the HTML Reference guide supplied with ScriptWorx.

Link To: This specifies the URL of the page you wish to move to. This can take the form of http://myname/document.htm or it can be /directory/document.htm. You can also use links to e-mail addresses, newsgroups, resources and secure pages.

Target: In a frames-based site, this tells the browser the name of the frame to display the page in. It can also define if the hyperlink will open in a new window (_blank) or this default can be left blank.

Style: This is an example of in-line style sheets. You can specify any CSS values here of the format:

body-background: #ffffff; font-family: Verdana, Arial;

Name: This can be used to assign a name to a hyperlink object, which can be useful when combined with JavaScript.

Class: If a style-sheet class has been defined by a pair of <style></style> tags or in an external stylesheet, the formatting of the class can be applied to the hyperlink by using this option.

How do I do this?

Insert Menu: Hyperlink


Types of Hyperlink

A hyperlink acts as a link between two resources, or on the web, between two pages. However, you may wish to provide links to an e-mail address, or even a news server. The following is a good example of all the different types of link:

Type | Prefix | Example
Web Page | http:// | http://www.softlite.net
FTP Server | ftp:// | ftp://null.softlite.net
Email mailto: mailto:support@softlite.net
News | nntp:// | nntp://news.softlite.net


XML in ScriptWorx

XML is not a fixed format like HTML (a single, predefined markup language). It what is known as a `metalanguage' (a language for describing other languages) that lets you design your own customized markup languages for limitless different types of documents.

XML documents are text based and readable to humans using a text editor and some Web browsers. XML is a language for defining the meaning of information. It provides you with rules for defining and organizing information within a document, but it puts the burden of defining markup on your shoulders.

XML syntax is not that complicated. An XML document usually starts with a prolog although this is not necessarily required. If a document contains a prolog the minimum it must contain is the version of the XML specification to which the document conforms ie <?xml version="1.0"?> Documents may also use the prolog to to specify the character set used to encode the document.

Do not confuse the term `tag' with the term `element'. They are not interchangeable. An element usually contains two different kinds of tag: a start-tag and an end-tag, with text or more markup between them.

Several elements are included in an XML document. Each document must have one and only one root element. If you are familiar with tree structures the root element is the single 'parent' node at the top of the inverted tree from which all other elements descend. The content of an XML document is supposed to be self describing, in the example below there is a root element called "invoice":

<?xml version="1.0"?>

<invoice>

</invoice>

The first mention of "invoice" is the start tag for the element and the second that closes the element is the end tag, an end tag will start with "</"

The element "invoice" is currently empty and should it remain empty in the finished document the start and end tags can be abbreviated to <invoice/>.

However elements do usually have content. The content is anything that is placed between the start tag and the end tag including text and child elements.


XML in ScriptWorx

Expanding the above example the invoice is now required to indicate the payee and goods purchased. For ease of readability the elements in this example are shown indented, however the XML specification does not require you to indent document contents.

<?xml version="1.0"?>

<invoice>

<customer>

Mr J Doe

<company>

Anonamix

</company>

</customer>

<item quantity="10" price ="29.99">

ready mix cement, gross

</item>

</invoice>

The element "customer" identifies the person who ordered the goods. This element contains a set of text "Mr J Doe" and a child element identifying the customer's company. An element with this type of content is said to have mixed content as it contains both text and a child element. The element "company" has simple content as it contains only text. Should an element only contain elements its content is said to be element content.

There is also an "item" element in the "invoice", this identifies the goods ordered by the "customer" Mr J Doe. This item element has two attributes "quantity" and "price". XML attributes are similar to those used in HTML, containing information relevant to an element. The value assigned to an attribute must be enclosed by single or double quotes.

The quantity and price attributes may also have been written as child elements of "item" in this way:

<?xml version="1.0"?>

<invoice>

<customer>

Mr J Doe

<company>

Anonamix

</company>

</customer>

<item>

ready mix cement, gross

<quantity>

10

</quantity>

<price>

29.99

</price>

</item>

</invoice>


XML in ScriptWorx

Opinion differs as to what should be an attribute and what should be an element. Often it comes down to personal preference and sometimes to how the data is to be used. If the data describes something about the element, however it is not of general interest to the application processing the document then it would be most likely to be an attribute.

An invoice requires information about the sales tax and the total amount due:

<?xml version="1.0"?>

<invoice>

<customer>

Mr J Doe

<company>

Anonamix

</company>

</customer>

<item quantity="10" price ="29.99">

ready mix cement, gross

</item>

<tax>

12.00

</tax>

<totaldue>

299.99

</totaldue>

</invoice>

Even the untrained eye can see that this XML document contains an invoice. It is easy to identify the name and company of the customer, what was purchased and what they are due to pay. The document content is self describing. However, the document does not state how it is to be displayed, that is left to an external software application such as a job that prints out invoices each night.


XML in ScriptWorx

This sample XML document is considered to be 'well formed'. The XML specification states that an XML document is well formed only if it meets the syntax requirements listed in the XML specification. In this particular example the important requirements are:

•The document must have only one root element.

•Each start tag has an end tag.

•The end tags are properly nested, ie a parent's end tag does not occur before any of its children's end tags.

•The element names are valid.

Character Sets

XML specifications support a wide variety of character sets. It requires that XML processors are able to read documents encoded in either UTF-8 or UTF-16.

Documents encoded in UTF-16 must begin with a Byte Order Mark that indicates whether the encoding is UTF-16 big endian or UTF-16 little endian. The specification requires that any documents encoded in a format other than UTF-8 or UTF-16 place an XML encoding declaration at the start of the document. This declaration is held in the document's prolog in this way:

<?xml version="1.0" encoding="EUC-JP"?>

An XML processor is not required to recognize any encodings other than UTF-8 and UTF-16.

Case Sensitivity and White Space

In XML documents element tags and attribute names are case sensitive. This means that the element called "invoice" will not match the element called "Invoice". It is therefore desirable when you define the element names for a document to decide on one style and stick with it.

Characters such as spaces, tabs and line terminators are included in white space. XML processors by default preserve all the white space within a document as the white space may be relevant to its meaning.

There are however, two exceptions to this rule.

1.Text files written using applications running in the Windows Operating system have a tendency to terminate lines with carriage returns and line feed characters. XML processors changes line terminators into single line feed characters.

2.White space between element tags is considered superfluous and is removed.

Parsed and Unparsed data

As an XML element may contain child elements all text within an element is parsed. This means that if the text needs to include a character that XML uses to delimit element tags XML will treat those characters as tag delimiters. EG, this text would be parsed as a text section followed by a malformed element start tag:

WE THANK YOU FOR YOUR CUSTOM. YOURS SINCERELY <name here>


XML Inspector

The XML Inspector displays the attributes and properties for a selected node in a grid format to allow easy editing.

A right mouse click presents you with a drop down box displaying the following options:

Option | Description
Add Attribute | Allows a new attribute to be added to a node
Remove Attribute | Allows an attribute to be removed from a node
Edit Full Attribute | Allows editing of an attribute in a new context sensitive editing window
Select Namespace Attributes | Ensures that each node can be uniquely identified in an XML document
Add GUID | Adds a General Unique Identifier

How do I do this?

Click on any line of the XML Inspector


XML Tag Tree

The TagTree is arranged in much the same way as the root directory in MS Windows displaying XML nodes in a nested format.

By highlighting a node and clicking the right mouse button a drop down menu appears with these options:

Option | Description
Delete Node | Deletes the selected node and all nodes nested in it.
Preserve Space | Preserves white space in the selected node
Cut | Cuts the selected node and all nodes nested in it
Copy | Copies the selected node and all nodes nested in it onto the clipboard
Paste | Pastes the contents of the clipboard

How do I do this?

Right-click on any node on the XML Tag Tree


Setting Up a DSN

A DSN is a shortcut that can be used to create connections to databases, such as Access, Oracle and Paradox. To establish a DSN connection in ScriptWorx, you must set up a DSN on your computer.

Setting Up a DSN in Windows 2000

Start .. Settings .. Control Panel .. Administrative Tools .. Data Sources

Setting Up a DSN in Windows 95, 98, ME and NT 4

Start .. Settings .. Control Panel .. ODBC Data Sources Click on the "System DSN" tab.

Choose "Add". Choose a driver type - like "Microsoft Access Driver (*.mdb). Add a unique name for the DSN. Choose a database by using the "Select..." button. Close the ODBC Setup Dialog. Exit the Control Panel.


Reusable Connections

Rather than having to generate a connection using the Connection Wizard, especially if you already have the code on the page, reusable connections can help you. Additionally, you may wish to insert a field, but if you don't want to create a new connection, the reusable connections are also of benefit.

Open up the Database Code Controller Panel - choose Load Existing Recordset. Any recordset you saved with the Database Connection Wizard can be accessed here. To modify the connection, click on the Edit button after selecting the connection from the list.

You can also create a new connection here, however, you must proceed through the Connection Wizard first. Once you've saved the recordset, the code will be added to your page whilst the new connection is saved. Connections can also be deleted here.


Insert SQL Command

Inserting data into a ScriptWorx.NET dataset from a form can be achieved by using the "Insert" SQL command, which usually takes the form of.

INSERT INTO {tablename} VALUES {values}

First, choose a pre-existing connection, then select a table name. The table name refers to the table in the database, with which you wish to insert the data.

Assuming that an HTML form has been created, associate each database field in this list by double-clicking the Fields list, then selecting the form field.

Redirection routes the user to a confirmation page when the action is complete.

How do I do this?

Database Menu: Insert Record


Update SQL Command

Inserting data into a ScriptWorx.NET dataset from a form can be achieved by using the "Update" SQL command.

First, choose a pre-existing connection, then select a table name. The table name refers to the table in the database, with which you wish to update the data.

Assuming that an HTML form has been created, associate each database field in this list by double-clicking the Fields list, then selecting the form field.

Redirection routes the user to a confirmation page when the action is complete.

How do I do this?

Database Menu: Update Record


Delete SQL Command

Removing data into a ScriptWorx.NET dataset from a form can be achieved by using the "Delete" SQL command.

First, choose a pre-existing connection, then select a table name. The table name refers to the table in the database, with which you wish to remove the data.

The field name and value filter out a record to be deleted. For instance, you may wish to delete a record WHERE id <> 0

Redirection routes the user to a confirmation page when the action is complete.

How do I do this?

Database Menu: Delete Record


ASP.NET Records

Places dynamic code in an ASP document returning the number of rows of data in the dataset.

How do I do this?

Database Menu: ASP.NET Records


ASP.NET Results

Uses ASP.NET Web Forms to present the results of a database query as a grid in HTML format.

How do I do this?

Database Menu: ASP.NET Results


Create a Table

To create a table, load the wizard using the commands above. You will now see the Table Wizard, with its own Code Controller Panels docked to the side of the wizard.

Editing a cell is very easy; simply double-click the cell you wish to edit and then insert your text. When you have designed a structure, added some formatting and finally, some text, press "OK" to have the table inserted into your document.

Table formatting is controlled by the "Formatting" code controller panel, simply click the "View" menu, select "Code Controller Panels" and then click "Formatting".

The Table Wizard has two Code Controller Panels, which may be accessed by opening the "View" menu and selecting the "Code Controller Panels" option.

Structure Panel: This panel allows you to add and remove single or multiple columns, just by clicking the appropriate item on the panel.

Formatting Panel: When the Table is translated into HTML, the formatting attributes specified here are used when adding the table to your document.

How do I do this?

Insert Menu: Table