+ All Categories
Home > Documents > Learning XML

Learning XML

Date post: 08-Dec-2016
Category:
Upload: lythuan
View: 213 times
Download: 1 times
Share this document with a friend

If you can't read please download the document

Transcript

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0201.xml Sarah Reminder Don't forget to recharge K-9 twice a day. Also, I think we should have his bearings checked out. See you soon (or late). I have a date with some Daleks... The Doctor

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0203.xml Sarah Jane Reminder Don't forget to recharge K-9 twice a day. Also, I think we should have his bearings checked out. See you soon (or late). I have a date with some Daleks... Doctor Who

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0204.xml Sonic Screwdriver 9000 User Manual Indigo Riceway

Preface

Availability

The information in this manual is available in the following forms:

Instant telepathic injection Lumino-goggle display Ink on compressed, dead, arboreal matter Cuneiform etched in clay tablets

The Sonic Screwdriver 9000 is sold in galactic pamphlet boutiques or wherever Cybertronix equipment can be purchased. For more information, or to order a copy by hyperspacial courier, please visit our universe-wide Web page at http://www.cybertronix.com/sonic_screwdrivers.html.

Notice While everyeffort has been taken to ensure the accuracy andusefulness of this guide, we cannot be held responsible for theoccasional inaccuracy or typographical error.

Introduction

Congratulations on your purchase of one of the most valuable tools inthe universe! The Cybertronix Sonic Screwdriver 9000 isequipment no hyperspace traveller should be without. Some of themyriad tasks you can achieve with this device are:

Pick locks in seconds. Never be locked out of your tardisagain. Good for all makes and models including Yale, Dalek, andXngfzz. Spot-weld metal, alloys, plastic, skin lesions, and virtually anyother material. Rid your dwelling of vermin. Banish insects, rodents, and computerviruses from your time machine or spaceship. Slice and process foodstuffs from tomatoes to brine-worms. Unlike aknife, there is no blade to go dull. Here is what satisfied customers are saying about their CybertronixSonic Screwdriver 9000:

Should we name the people who spoke these quotes? --Ed.

It helped me escape from the prison planet Garboplactor VI. Iwouldn't be alive today if it weren't for my Cybertronix 9000.

As a bartender, I have to mix martinis justright. Some of my customers get pretty cranky if I slipup. Luckily, my new sonic screwdriver from Cybertronix is so accurate,it gets the mixture right every time. No more looking down the barrelof a kill-o-zap gun for this bartender!

Mastering the Controls

Overview

is a diagram of the parts of yourSonic Screwdriver 9000.

Exploded Parts Diagram

lists the function of the parts labeled in the diagram.

Control Descriptions Control Purpose Decoy Power Switch Looks just like an on-off toggle button, but only turns on a smallflashlight when pressed. Very handy when your Sonic Screwdriver 9000 is misplacedand discovered by primitive aliens who might otherwise accidentallyinjure themselves. Real Power Switch An invisible fingerprint-scanning capacitance-sensitive on/off switch. The Z Twiddle Switch We're not entirely sure what this does. Our lab testers have hadvarious results from teleportation to spontaneousliquification. Use at your own risk!

A note to arthropods: Stop forcing your inflexible appendages to adoptun-ergonomic positions. Our new claw-friendly control template isavailable.

Power Switch

Why a decoy?

Talk about the Earth's Tunguska Blast of 1908 here.

The View Screen The view screen displays error messages and warnings, such as a LOW-BATT 14(low battery) message.

The advanced model now uses a direct psychic link to the user'svisual cortex, but it should appear approximately the same as the moreprimitive liquid crystal display.

When your Sonic Screwdriver 9000 starts up, it shouldshow a status display like this:

STATUS DISPLAYBATT: 1.782E8 VTEMP: 284 KFREQ: 9.32E3 HzWARRANTY: ACTIVE

The Battery Your Sonic Screwdriver 9000 is capable of generating tremendous amounts ofenergy. For that reason, any old battery won't do. The power source isa tiny nuclear reactor containing a piece of ultra-condensed plutoniumthat provides up to 10 megawatts of power to your device. With ahalf-life of over 20 years, it will be a long time before areplacement is necessary.

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0301.xml

Sarah Bellum Vice President Luke Bizzy Manager Eddie Puss Sales Clerk Mary Anette Sales Clerk Bubba Gumb Accounts Officer

Tim Burr Vice President Laurie Keet Promotions Officer Abel Boddy Advertising Officer

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0304.xml Evil Science Institute

Welcome to Dr. Indigo Riceway's Institute for Evil Science!

Table of Contents

Meet Our StaffExciting CoursesGroundbreaking ResearchContact Us

Meet Our Staff

Dr. Indigo Riceway Founder of the institute, inventor of the moon magnet and the metal-eating termite, three-time winner of Most Evil Genius award. Teaches Death Rays 101, Physics, Astronomy, and Criminal Schemes. Dr. Ruth "Ruthless" Grzinsky Mastermind of the Fort Knox nano-robot heist of 2002. Teaches Computer Science, Nanotechnology, and Foiling Security Systems. Dr. Sebastian Zucav A man of supreme mystery and devastating intellect. Teaches Chemistry, Poisons, Explosives, Gambling, and Economics of Extortion.

Exciting Courses

Choose from such intriguing subjects as

Training Cobras to KillCare and Feeding of Mutant BeastsSuperheros and Their WeaknessesThe Wonderful World of MoneyHijacking: From Studebakers to Supertankers

Groundbreaking Research

Indigo's Evil Institute is a world-class research facility. Ongoing projects include:

Blot Out The Sky

A diabolical scheme to fill the sky with garish neon advertisements unless the governments of the world agree to pay us one hundred billion dollars. Mha ha ha ha ha!

Killer Pigeons

A merciless plan to mutate and train pigeons to become efficient assassins, whereby we can command huge bounties by blackmailing the public not to set them loose. Mha ha ha ha ha!

Horror From Below

A sinister plot so horrendous and terrifying, we dare not reveal it to any but 3rd year students and above. We shall only say that it will be the most evil of our projects to date! Mha ha ha ha ha!

Contact Us

If you think you have what it takes to be an Evil Scientist, including unbounded intellect, inhumane cruelty, and a sincere loathing of your fellow man, contact us for an application. Send a self-addressed, stamped envelope to:

The Evil Science Institute,Office of Admissions,10 Clover Lane,Death Island,Mine Infested Waters off the Coast of Sri Lanka

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0401.xml The Evil Science Institute

Welcome to Dr. Indigo Riceway's Institute for Evil Science!

Table of Contents

Meet Our StaffExciting CoursesGroundbreaking ResearchContact Us

Meet Our Staff Dr. Indigo Riceway Founder of the Institute, inventor of the moon magnet and the metal-eating termite, three-time winner of Most Evil Genius award. Teaches Death Rays 101, Physics, Astronomy, and Criminal Schemes. Dr. Ruth "Ruthless" Grzinsky Mastermind of the Fort Knox nano-robot heist of 2002. Teaches Computer Science, Nanotechnology, and Foiling Security Systems. Dr. Sebastian Zucav A man of supreme mystery and devastating intellect. Teaches Chemistry, Poisons, Explosives, Gambling, and Economics of Extortion.

Exciting Courses

Choose from such intriguing subjects as...

Training Cobras to KillCare and Feeding of Mutant BeastsSuperheros and Their WeaknessesThe Wonderful World of MoneyHijacking: From Studebakers to Supertankers

Groundbreaking Research

Indigo's Evil Institute is a world-class research facility. Ongoing projects include:

Blot Out The Sky

A diabolical scheme to fill the sky with garish neon advertisements unless the governments of the world agree to pay us one hundred billion dollars. Mha ha ha ha ha!

Killer Pigeons

A merciless plan to mutate and train pigeons to become efficient assassins, whereby we can command huge bounties by blackmailing the public not to set them loose. Mha ha ha ha ha!

Horror From Below

A sinister plot so horrendous and terrifying, we dare not reveal it to any but 3rd year students and above. We shall only say that it will be the most evil of our projects to date! Mha ha ha ha ha!

Contact Us

If you think you have what it takes to be an Evil Scientist, including unbounded intellect, inhumane cruelty and a sincere loathing of your fellow man, contact us for an application. Send a self-addressed, stamped envelope to:

The Evil Science Institute,Office of Admissions,10 Clover Lane,Death Island,Mine Infested Waters off the Coast of Sri Lanka

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0402.css/* ------------- SECTIONS -------------*/

body { color: black; background-color: silver;}

.section { margin: .5em; padding: .5em; border: thick solid gray; background-color: white;}

.toc { margin: .5em; padding: .5em; border: thick solid gray; background-color: white;}

/* ------------- HEADS -------------*/

body > h1 { color: black; font-size: 3em; font-family: sans-serif;}

.section > h2 { color: green; font-size: 2em;}

.toc > h2 { color: blue; font-size: 2em;}

.projectname { color: navy; font-size: 1.5em; font-style: italic; font-family: sans-serif;}

/* ------------- BLOCKS -------------*/

p { font-size: 1.2em;}

p.bigp { font-size: 1.5em;}

p.projdesc { margin: .25em;}

address { color: black; white-space: normal; font-size: 2em; font-family: monospace;}

div li { font-size: 1.4em; font-family: sans-serif;}

dd { color: black; font-size: 1.2em; margin: 1em;}

/* ------------- INLINES -------------*/

em { font-style: italic; font-weight: bold;}

.laughter { color: purple; font-style: italic; font-weight: bold;}

.person { font-weight: bold;}

.inst { font-style: italic;}

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0501.xml

Bob's Bolts 987.32 21-6-00 Paycheck

Kimora's Sports Equipment 132.77 23-6-00 Kendo equipment

40.00 24-6-00 Pocket money

Lone Star Cafe 36.86 26-6-00 Lunch with Greg

Wild Oats Market 47.28 29-6-00 Groceries

Barnes and Noble 58.79 30-6-00 O'Reilly Books

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0502.dtd

Example 5-3:

%calstbls;

%ISOamso;%ISOamsr;%ISOgrk3;%ISOlat1;%ISOlat2;%ISOnum;%ISOpub;%ISOtech;

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0601.xsl

Quotes

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0602.xml

Drinking coffee could protect people from radioactivity, according to scientists in India who have found that mice given caffeine survive otherwise lethal doses of radiation. The New Scientist 6/99

Find out which episode. Trying is the first step before failure. Homer The Simpsons

Hard work has a future payoff. Laziness pays off now.

I keep having these fantasies where the Dead Sea Scrolls are full of assembly code. Greg Travis

The tongue is the only weapon that becomes sharper with constant use.

The superior person understands what is right; the inferior person knows what will sell. Confucius

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0604.xml

Bob's Bolts 987.32 21-6-00 Paycheck

Kimora's Sports Equipment 132.77 23-6-00 kendo equipment

40.00 24-6-00 pocket money

Lone Star Cafe 36.86 26-6-00 lunch with Greg

Wild Oats Market 47.28 29-6-00 groceries

Barnes and Noble 58.79 30-6-00 O'Reilly Books

Old Man Ferguson 800.00 31-6-00 a 3-legged antique credenza that once belonged to Alfred Hitchcock

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0605.xsl

Income from until : Expenditures from until , ranked from highest to lowest: Balance Your balance as of is $ $ DANGER! Deposit money quick!

. On , you withdrew $ from an ATM for .

. On , you paid $ to for .

. On , $ was deposited into your account by .

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0607.xsl

Error while creating file.

by

Table of Contents

Preface

ch .html Chapter :

O'Reilly Learning XML/learning xml - examples (unix+linux)/ex0801.pl#!/usr/bin/perl -w#

use strict;

# Global variables#my %frefs; # file entities declared in internal subsetmy %element_frequency; # element frequency listmy $lastline = ""; # the last line parsedmy $allnodecount = 0; # total number of nodes parsedmy %nodecount = # how many nodes have been parsed ( 'attribute' => 0, 'CDMS' => 0, 'comment' => 0, 'element' => 0, 'PI' => 0, 'text' => 0, );

# start the process&main();

# main# ----# parse XML document and print out statistics#sub main { # read document, starting at top-level file my $file = shift @ARGV; unless( $file && -e $file ) {print "File '$file' not found.\n";exit(1); } my $text = &process_file( $file ); # parse the document entity &parse_document( $text );

# print node stats print "\nNode frequency:\n"; my $type; foreach $type (keys %nodecount) {print " " . $nodecount{ $type } . "\t" . $type . " nodes\n"; } print "\n " . $allnodecount . "\ttotal nodes\n";

# print element stats print "\nElement frequency:\n"; foreach $type (sort keys %element_frequency) {print " " . $element_frequency{ $type } . "\t\n"; }}

# process_file# ------------# Get text from all XML files in document. #sub process_file { my( $file ) = @_; unless( open( F, $file )) {print STDERR "Can't open \"$file\" for reading.\n";return ""; } my @lines = ; close F; my $line; my $buf = ""; my $linenumber = 0; foreach $line (@lines) {

# Tack on line number and filename information$linenumber ++;$buf .= "%$file:$linenumber%";# Replace external entity references with file contentsif( $line =~ /\&([^;]+);/ && $frefs{$1} ) { my( $pre, $ent, $post ) = ($`, $&, $' ); my $newfile = $frefs{$1}; $buf .= $pre . $ent . "\n" .&process_file( $frefs{$1} ) . "" . $post;} else { $buf .= $line;}

# Add declared external entities to the list.# NOTE: we do not handle PUBLIC identifiers!$frefs{ $1 } = $2 if( $line =~ /


Recommended