Robert's Nook

Family & Friends

My Family's Home Page
My Home Page
My Photos on MSN
Matthew's Page

Picture of Matthew and I with Pacific Swift in background

Technology Links

Microsoft XSL Debugger Demo

Microsoft XSL Debugger

Microsoft MSXSL Command-line Transformation Tool

Microsoft Video Control in VB Form

Microsoft "The .NET Show"

Microsoft TCP/IP on Windows 2000 - White Paper

ECMAScript (JavaScript) Documentation

PowerToys for XP

Private/shared/side-by-side assemblies described

Google Tips

Joel on Software - Unicode

My Code Samples and other stuff I did

XML Data Islands (Matthew's Damage Calculator)

DHTML Sample Code

My XSLT Expression Processor

Article I wrote on Universal Data Access

Ken North's ODBC Hall of Fame

MMC Notes From Microsoft

Various specialized scripts

Tweaked sample code from an article to create a Moniker-based out-of-proc COM server - one instance per named object.

Security

Microsoft's Federated Security and Identity Roadmap

Microsoft Security Tools and Checklists

Microsoft Baseline Security Analyzer

Microsoft IIS Lockdown tool

Windows IT Library: How to protect your system

 

Name:  Robert Houben
email:  
 (daytime)  
 (evenings)  
Phone:  
 (daytime)  (604) 777-4254
 (evenings)  (604) 434-5107
City  Vancouver, BC

Fun Stuff

Talk to Eliza

BC Political Humour

Interesting Articles

Edward Dijkstra: Goto considered joyful - About pondering as a science

Joel on Software: What it takes to run a software company.

Interesting Downloads

Windows XP Experiences

PC Magazine Free Utilities

Notes

Regedit

/s will surpress confirmation boxes and the removal of a key is as simple as putting a minus sign in front of the key in the reg file. e.g.:
   [-HKEY_LOCAL_MACHINE\SOFTWARE\Foo]
will clear all configuration settings.

 

More Tech Links

Extended MAPI

Business Process Markup Language (BPML)

Bugslayer Article on Symbol Server

W3 Design Issues

DHTML Reference Guide

Web Services Glossary

Windows Data Alignment

TaskList Program

NoClick JavaScript  

Notes About XML Schema

Wildcards

There are 3 kinds of "any"s (wildcards): strict, lax, and skip. If you specify "skip", then for sure there won't be validation errors inside the element that matches this "any". If you specify "lax", then you might get some error (if there happen to exist an element declaration that matches one of the elements to be hidden, or if there is an xsi:type on one of those elements). If you specify "strict" (the default), then 99% you'll get some error.

So use <any processContents="skip" ...> and you are set.

Validate Against a Schema

Set "http://apache.org/xml/features/validation/schema" to true. It means validate against a schema, not validate a schema.

Validating With DOM

JAXP 1.2 also defines schema support for the DOM parser, as shown in Listing 4. The procedure is very similar to that of a SAX parser, the only difference being that you set attributes on the factory object instead of properties on the parser object. The detailed procedure is:

1. Create a DOMBuilderFactory object. 2. Set the namespace-aware and validating properties to true. 3. Set the attributes for the schema language and schema source. If your parser is not JAXP 1.2-compliant, it will throw an IllegalArgumentException exception. 4. Obtain a DocumentBuilder object (the parser). 5. Register an ErrorHandler object with the parser. 6. Parse the document.

This example only demonstrates validation. Your application could do more interesting things with the parse tree.

See the Code Sample Below

     

ValidateDOM.java



package org.ananas.tips;

import java.io.*;
import org.xml.sax.*;
import javax.xml.parsers.*;

public class ValidateDOM
{
public static String SCHEMA_LANGUAGE ="
http://java.sun.com/xml/jaxp/properties/schemaLanguage",
XML_SCHEMA ="
http://www.w3.org/2001/XMLSchema",
SCHEMA_SOURCE ="
http://java.sun.com/xml/jaxp/properties/schemaSource";

public final static void main(String[] args)
    throws IOException, SAXException, ParserConfigurationException
{
    if(args.length < 2)
    {
        System.err.println("usage is:");
        System.err.println(" java -jar tips.jar -validatedom " + "input.xml schema.xsd");
        return;
    }

    File input = new File(args[0]),
    schema = new File(args[1]);

    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    factory.setValidating(true);

    try

    {
        factory.setAttribute(SCHEMA_LANGUAGE,XML_SCHEMA);
        factory.setAttribute(SCHEMA_SOURCE,schema);
    }
    catch(IllegalArgumentException x)
    {
        System.err.println("Your DOM parser is not" + "JAXP 1.2 compliant.");
    }

    DocumentBuilder parser = factory.newDocumentBuilder();
    parser.setErrorHandler(new ErrorPrinter());
    parser.parse(input);
}
}

NoClick JavaScript

<script language="JavaScript">
// The \n is a newline character. Change this to whatever suits you!
var message="Thank you for visiting :)\n\nCopyright 2003 ? Loretta Houben";

// This gets called when you click either mouse button.
function click(e)
{
if (document.all)
{
// for event.button 1 is left mouse button, 2 is right mouse button
if (event.button == 2)
{
alert(message);
return false;
}
}
}

// This tells the browser to call our function when the mouse button is pressed.
document.onmousedown=click;
</script>