Listing 15.1[em]A document-start Rule document-start ;event output "%n" ;our action || "%n" || "Our first example%n" || "%n" Listing 15.2[em]A document-end Rule document-end ;event output "%n%n" Listing 15.3[em] Using the Parse Continuation Operator element musician ; event, when the element musician is encountered output "
%n" ; at the start of the element output "%c" ; continue parsing output "
%n" ; at the end of the element Listing 15.4[em] Using the Suppress Action element meta ; event, when the element meta is encountered suppress ; continue parsing but suppress output Listing 15.5[em] Using a Condition Referring to an Attribute Value element steps when attribute experience = "firsttime" ;action Listing 15.6[em] Checking the Parent Element. element li when parent is ol ; action Listing 15.7[em] Checking the Ancestors element p when ancestor is li ; action Listing 15.8[em] Checking the Previous Element element p when previous is title ; action Listing 15.9[em] Using a Combination of Context Conditions element def when parent of parent is ol ; action Listing 15.10[em] Using an Occurrence Condition element li when occurrence = 2 ;action Listing 15.11[em] Using the Number of Children Condition element p when children of parent = 1 ;action Listing 15.12[em]A Piece of XML to be Converted Amsterdam Paris Toronto Vancouver Brussels Listing 15.13[em]nrofcities.xom[md]Using referents. global counter nrofcities initial {0} ; a variable with name "nrofcities" and value "0" element cities ;rule output "%c" ; continue parsing element city increment nrofcities ; the variable "profcities" is incremented (+1) output "

" output "City %d(nrofcities) of " ; the value of variable "nrofcities" is sent to the output output referent "totalofcities" ; the referent is the placeholder for the not known yet value of the total of cities ; the content of the placeholder is sent to the output output "
" output "%c" output "

" set referent "totalofcities" to "%d(nrofcities)" ; the value of "nrofcities" is placed in the placeholder ; after the first its 1, then 2, and finally for our example 5 Listing 15.14[em].biblio.xml[md]The xml File to Convert to HTML ]> Sam's Teach Yourself C++ in 21 Days, Second Edition Jesse Liberty This book teaches you the basics of object-oriented programming with C++ and is completely revised to ANSI standards. It can be used with any C++ compiler. 0-672-31070-8 700 Beginning - Intermediate 29.99 Teach Yourself Visual C++ 5 Maximum Java 1.1 Glenn Vanderburg Written by JAVA experts, this book explores the JAVA 1.1 language, tools, and core JAVA API without reviewing fundamentals or basic techniques. 1-57521-290-0 900 Expert 49.99 JavaScript Unleashed, Second Edition Richard Wagner This book helps you thoroughly understand and apply JavaScript. 1-57521-306-0 1000 Casual - Experienced 49.99 Sam's Teach Yourself Visual C++ 5 in 21 Days, Fourth Edition Nathan Gurewich Ori Gurewich This book merges the power of the best-selling "Teach Yourself" series with the knowledge of Nathan and Ori Gurewich, renowned experts in code, creating the most efficient way to learn Visual C++. 0-672-31014-7 832 New - Casual 35.00 Jesse Liberty C Glenn Vanderburg Java Richard Wagner Opera Nathan Gurewich Visual Basic Visual C++ Listing 15.15[em]tohtml.xml[md]Our Omnimark Script to Convert the File biblio.xml to HTML DOWN-TRANSLATE with XML element biblio output "%n" || "%n" || "My bookshop%n" || "%n" || "%n" || "

My bookshop

%n

 

%n" || "%c" ; continue parsing element books output "%c" element book output "%c" do when last subelement is related output "

" done output "
%n" element title output "

" using attribute id of parent do when attribute id is specified output "" done output "%c

%n" element author do when previous is title output "

%c" else output "
%n" || "%c" done element description output "

%n" ; closing the p element started with the first author || "
%n" || "

%c

%n" element ISBN output "

ISBN-number: %c
%n" element pages output "%c pages
%n" element targetgroup output "Aimed at the '%c'
%n" element price output "%c US$

%n" element related do when occurrence = 1 output "

See also:
" done output "%c
" element authors output "

An overview of our writers

%n" output "" output "%n" output "%c
NameSpecialty
%n" element authordesc output "%c%n" element name output "%c%n" element specialty do when occurrence = 1 output "%c" else output " - %c" done document-end output "" Listing 15.16[em]tohtml.xml[md]Conversion to Multiple HTML Files element book local stream bookhtm ;creating a variable with name "bookhtm"" of type stream open bookhtm as file "%v(id).htm" ; this stream is written to a file, based on the id of the book element using output as bookhtm ; now we write the output to this stream (file) do ;everything between 'do' and 'done' needs to go to the stream output "%n" || output "%n" || output "Book %v(id)"%n || output "%n" || output "%n" output "%c" do when last proper subelement is related output "

" done output "
%n" output "%n" done element authors local stream authorshtm open authorshtm as file "authors.htm" using output as authorshtm output "%n" || output "%n" || output "Authors"%n || output "%n" || output "%n" output "

An overview of our writers

%n" output "" output "%n" output "%c
NameSpecialty
%n" output "%n" done Listing 15.17[em]tohtml.xml[md] Adding a TOC. global stream toc; to be used later on as a referent element biblio output "%n" || "%n" || "My bookshop%n" || "%n" || "%n" || "

My bookshop

%n

%n" output referent "toc" ; here we will (out)put our toc open toc as referent "toc" ; and we initialise it put toc "

Table of Contents

%n