Class xmllink2


public final class xmllink2
extends Object
Test program for the w3c.xmlOnline.parser, w3c.xmlOnline.tree, and w3c.xmlOnline.xptr packages. It uses the parser to parse an XML file (either stdin or given on command line) and uses the TreeListener class to build a tree.

It then expands any links in the document that have ACTUATE="auto" and SHOW="embed". After that, it prints the result on stdout. Note that it expands recursively: if the expanded element itself contains links, they are expanded as well. Adding that capability is easy, but making sure that the program doesn't go into a loop is harder, so I omitted that check for now...

The replaced part is enclosed in a sub-doc (!doctype), so that the result is still valid. The subdoc cannot be validated, and therefore it has no URL to point to a DTD.

For example, a source anchor like this:

 <anchor xml-link="simple" show="embed" actuate="auto" href="..."/>

is expanded to:

 <!doctype expanded-anchor>

$Id: xmllink2.html,v 1.3 1997/06/09 22:26:59 bbos Exp $
Bert Bos
See Also:
XMLTokenizer, Node, TreeListener, Parser, ParserDef

Constructor Index

 o xmllink2()

Method Index

 o main(String[])


 o xmllink2
 public xmllink2()


 o main
 public static void main(String argv[]) throws IOException, UnknownEncoding, IllegalXptrException