]> gitweb.factorcode.org Git - factor.git/blob - basis/xml/dispatch/dispatch-docs.factor
Merge branch 'master' into experimental
[factor.git] / basis / xml / dispatch / dispatch-docs.factor
1 ! Copyright (C) 2005, 2009 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax ;
4 IN: xml.dispatch
5
6 ABOUT: "xml.dispatch"
7
8 ARTICLE: "xml.dispatch" "Dispatch on XML tag names"
9 "Two parsing words define a system, analogous to generic words, for processing XML. A word can dispatch off the name of the tag that is passed to it. To define such a word, use"
10 { $subsection POSTPONE: PROCESS: }
11 "and to define a new 'method' for this word, use"
12 { $subsection POSTPONE: TAG: } ;
13
14 HELP: PROCESS:
15 { $syntax "PROCESS: word" }
16 { $values { "word" "a new word to define" } }
17 { $description "creates a new word to process XML tags" }
18 { $see-also POSTPONE: TAG: } ;
19
20 HELP: TAG:
21 { $syntax "TAG: tag word definition... ;" }
22 { $values { "tag" "an xml tag name" } { "word" "an XML process" } }
23 { $description "defines what a process should do when it encounters a specific tag" }
24 { $examples { $code "PROCESS: x ( tag -- )\nTAG: a x drop \"hi\" write ;" } }
25 { $see-also POSTPONE: PROCESS: } ;