Delphi Developer`s Guide to XML
Transcription
Delphi Developer`s Guide to XML
D e l p h G i D u e v i d e e l o t o p e X M r ’ s L Second Edition K eith W ood C a W t a o l o o g d i n , K g e - i n i t h - P , D 1 e M e e 9 n D p l o 1 ( D l o t i o v - 5 L v e a a t a - D 1 X e 1 i N . l i c 6 h B D b 9 l p I S 1 u o m 0 c e p 9 u n e r ’ s - 8 6 m e t . n I . G 2 t T u - 9 i d e ( p m a t o b X M L , S e c F r k u p l a n g u a g e ) . i r s t E e c o n d d E i t i o n d © k 2 b P 5 3 4 a r t o f t h , o r t r a n s y s t e m p h o t o c o p i s y i n I S B 0 N 8 Del p h m 1 9 en i t i o n - 5 7 i s a ed 9 6 1 0 5 r eg 9 4 - 8 3 i s t er ed a r e u s ed 6 2 E . 0 0 d D i t i o n e h i ( C l p b o u m i t t e d g , , e r m 0 / b y o i p 0 K m e p i t h W o o d . u t e r f i l e ) . 3 . C o m p u t e r s o f t w a r e — r i m b y u B b e a n i n i s s i o n a r e P o k , S r o d m e a n o r S W u o o d b l i s h i n g I n c . o t h f r o m r g S C , u e e u i t e 2 9 4 c e d s , , 1 1 6 8 s t o r e d e l e c t r o n e r w t h . a u u o a d r e p y g , e i t h s . c o m o R a r l e s t o n a y w K r e s e r v e d e s t e r b y 3 , o r d t s e d h r e c o r d W @ o r c h C 2 r i g h b l i s h D o k s m l l © 1 o o d o r t h p 1 w 1 N p d i t i o n A o n i t l e S N o k . ) i s e , w t h o r . a u i n i c , a r e t r i e v a l m i t h o u S t a t es e c h t w a n i c a l , r i t t e n 2 - 9 2 1 t r a d f o r em a r k o f B i d en t i f i c a t i o n o r l a n d p u r p o S s es o f t w o a r e C n l y a n d o r p m o r a t i o n a y b i n e t r a d t h em e U a r k n i t ed s o f t h ei r a n r es p d o t h ec t i v er e c o c o u m n t r i es . O p a n i es . t h er p r o d u c t s Contents Contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i P r ef a c e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i i i W h a t C o n C i s v o d i n t h e n t i o e D o e B o o k ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i i i n s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i i i w n l o a d s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i i i A A p p CU end E S D T T X T T X T m m X m X T m X T m X T m X T T m X m X T m X T m X T T m S u M D p p T P e n t u t T r o c e s s i n c u m o t a t i o n t i t y l E n t i t y R l D o o C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 l a s s 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p o 1 2 C c e C m e n o m p U 2 C l a s s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C l a s s E o S t a t i o m p n o n n C 2 D O M M e e s s a g A o e i l - O t h a n T e e m P e t h d T e r a r y u n f i g u c c e s s i n g a C p l a t e n r o p e r t i e s N o w 3 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a r s i n g t h o n s t r u c t i n e g X i d 4 M M L o g D d O m b e n t s 2 5 4 5 6 5 7 5 7 5 7 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . j e c t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . o c u e l 7 0 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i n 5 5 l i e n t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H 4 4 Cl i ent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . n 2 4 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a t i o 3 7 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i z ed 0 3 o s t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . g 0 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . e s t i n 7 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P 6 2 ts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . r a t i o 6 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . t h 4 5 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . e n t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . o f t 3 2 l a s s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . e n t 3 2 l a s s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . e n t 2 2 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . l a s s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C o C n l a s s 0 1 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . r a g e l C e C 6 0 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c t i o e 4 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . l e m d l a s s 3 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . g stom h e n l a s s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C l a s s e n t a r s e r B C I m a r y C C e f e r e n m t h el . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . y p e n t F j M g t i o od n l a s s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . l a s s m m c e p g I n s t r u n C c u b i x s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . n C e n t T l N c u t i o a t a e n t l E o g e l a s s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . e c t i o l P m i c l a s s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . m o j ec t M c e p a p l a s s C o o x e M C a t a S m x l a s s d t e C b E C o D I n f o r m C i s t e d N l C M m d E l C g i n n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 h a r a c t e r D I t g e r r o r e x i n p l a s s l C r o p end Cu e L n l T a s e l l u t t r i b a t a b o A S d l ec tr oni c a i l L l e m i x o a d D l E l A m a ss E L o l P m ent O t i o C a m i n end e l N l O o a d d l N l D m X L o l D m X m c e p a r s e r E l D m X T A m X T A m X T M m X T x l N m X oc u E l P m p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 M m X T p O X T p A of t’ s D T A i x 6 6 9 0 2 i A c c u S C S i i ex u h r o u u m l a t i n g P l i e n t T I nd m a v i n m P g r o p g C r o c e s s i n h a r y t h o n t e n t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 e r t i e s e B r o g 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 w 6 s e r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 0 1 P r ef a T c e h i s X b M o L o k i s c a n b d e u e s i g n s e d i n e d a s c o a n n j u i n t r o d u n c t i o n w c t i o i t h n t o D X e l p h M L a n d a n e x a m i n a t i o n o f h o w i . What is in the Book? T h e F A N e x M t p d d onv p end i c es i n c l u d e a d t h e r e i s s s i o n f o l l o w i c r o s o f t t e m C p i r s t l y p l a r e s c r i p t i o o w n d s D F i s c u a O l a t e . a r t i c u a c u M , i n a l l y n o e d f r o m t h a t h o m s e s X X e t o E s t o m e n D m O W b p i n v i n d e s A , b i t d f X a p t h m p p g r a m r o b e n o d m k . e . t h e e s s a g e f o r a s c a l , w r i a t e c o p r o p o a c k a g a r o u t h P i s l f o r f o r f o r o E a s e d a n X n U c l i e n t S e i t i o C f i l e w n e d t h n o o o k f i r s t m r o g r a m r a t i o a s e d a t i c a l l y e f r o t n f i g u i z e d t s , t h M a i l - o u c o m f r o o f t i t s c u m S m f o r o c u a u I n t e r n a t e r i a l U a s s L a d m C m M L t o e n a l t h l e i s M w t h i t i o o f i z a b e r e o f f u t h c l a s s l o a d s t o d a i t h a n t e n t e t . entions T h e m a i n i n t r o d u s a m p l e s , a n d m t e x c e d u T t h a n d i t e m s h r o u a t t e n t i o o f t h h T o o t o o t h t e t h n e s e t e a p e l p U b i s t e x e r I o o t a t i o k t i m D e n t e r e d o u h b f i r s t c e s a n d g n . e e r e f e r e n f i l e s , e n t f o r o h t k i p n t r o s e d p r o p i n a n d m r e s e n t e d l s a p s a n o r t i o p e a r i t e m d t h n a l f o a s d o e m d s , t h italics, c l a s s e s v a r i o u u a e a r a r e c o n s i n p s i n i n m a r k i n ( l i k e d g s s o n a m i s ) , w h i l e i t e m e s o font. f T d t e r m s . C s o d e i r e c t o r i e s h e n a m e s o f nt . f o a s d t h h a s i z e d e r i f a r e e p fixed sans- se m e a n o a a a r e e i r e t h n t t o b e s c r i b r i n e d g t h b e l o nd i ng e m w t o y o u r : NOTE A no t e i s i nf o r m at i o n o f p r o ak e b ab l e o r i nt e r e st l o p r e g ar d i ng t h e su r r o e asi e u t e x t . TI P A t i p W A A od R w t e C i s so x i ng t o m t h i ng y u d e v e m e nt w i t h X M L r . i s so m e t h at y o u ne e d t o b e aw ar e o f r e g ar d i ng t h e p r e c e d i ng t . h e c o nl oad d e s i t e : d s a m h t t p a r r a n g e d b p y : / / h s l e s o u m c h a p s e d e . i p t e r , r i m w i t h i n t h u s . c o i s m . a u t h a d d e b o o k a r e / k b w i t i o n a v a i l a b o o f o d / D a l e e l p s i n g l e o h n t h i X p M a c k e L a c c o . m D p t h a t o w a n n a g e s p e c i f i c a t i o y i n g W e b l o a d s i n c l u d a r e e s a l l t h e e . T a n d t h NI NG ow c o e ar ni ng e D T m h i s i t s e b s i t e r e l a t e d W t e c h a l s o n o l o p g r o v i d i e s . L e s i n k s l i n t o k s t o D e l p t h h e i v a r i o u r e s o u s r c e s f o r X M L n s a l s o f o r a p p X M L e a r . i i i A p p T e h e s e A D O y m o u t m p e n d p e n d i x i s T u n o P p p e n e r g i n s i n f i e l d s M p A c u s t o a s M a o v e n T p P . e d i s X b o n u s a t c h d l e , a n t h o u e r E a p i s T h e e f i r s t e d c u m e n t l e , i t i s t h a t w t o i t h s p s p e o i t i o O b n o f j e c t s t i l l i n u t h i s M o s e , b d o o e l . a n d k . A l t h o u f o r m s g t h h t h i s e b a s i s i t e . n w t e m t h D g r a m s e d t h f t a v a i l a b r o a l l o i n o s u a t i o u f r o m S a r t n e r i c h e m w e d l a t e f i r s t e r f o r m m t h t h e e e m F p f i g u d i n e s p a s s t e m n e d d o r m e c o b i n c l u l a c e . s e s s a g e c i f y a l s o p p a f o r n s t r a t e s a r e g o c u h o e n D o i m w i n n o S l e m A t o T a c u X h u e 1 n p e w y p e t h o e e l e c t r o l a t e r a t i o g f g a n n d i c n f i l e a s e s f r o a l t h S e Q L X m s e n v a l u a c t u r o c e s s i n o m m o r c l i e n t v U I l i a n t f t h b e r o w X i e - w G p n o u r o c e s s m s t o - c o e n t a t i o s e t t h w h i . i n A p t o t s h e l p w n s . a n m i n s h s e c t i o s e e d o r i t t e n n s t r a t i n y U d w L , t h e l l m q u M a i l - o u i n g a s t s e s e t h e d a t a b a s e e r y M u s e d t o i c r o s o f t ’ s u s e d . p o t e r s C f o r m n s e r c i a l l y L h t . C e e n e P i n a t i o e x d e m m M e c h a p t h L w t e x i x a m e r e s e n t s l a t e , t h m M a s e c l i e n t i e - w c o p i n f o r m e t w , B d e r s X d a t a b M v e r i z e d b L s m m k s X e g i x a r s e r p t h e l i n A p c o e r ’ s i t h i n t h L d i c i n c l u A t e m w t a i n X i c e s l o n S e d o w g g e s s a g o b o u r b A b a p p M f o r n I w h p w L e r i t h a r s e r C d d o c u o t h c u a p p r o p i s u t o a u e y a r e t o a m d o m m e n t o p ndl er n i n t o a r e n a v a t i c a l l y w t s e n t s r i a t e s e d ontentH s e r e n M a t c h l o a d u a s e d i g a t i o r o c e s s t h n e i n t e r f a c e . o p e d . e n t h e 2 A p p e n d i c e s A p p e n d i x A CUESoft’s Document O b j ect M C U E t i m S e i s o f t a s o n T e l p f o l l o s e v s o e r a l ideS T o f D v n s l l o s : 1 w . 2 U . 3 . C 5 6 l i c k . . a c h D O M a l l t h g o f s p e s e t h O e d D T p e c i f i c a t i o a d v a n t a g i l e d L i m s p d p e n t e d s h o n v e r y n c t i o h a n w e i s e , 5 . a s t h t h I n e a m e e d e r h a v i n W y i n g o u d o n a t i v r p w s , e o b r o g r a m t h i s j e c t s , w i t h o c l a s s e s n i n F c l o s e l y , n a n l y d g A o u s a b i l i t y . v a l u t h r e a l t h u s t r i n i n i g u g e h t h e s , n C - 1 . U C e y E X U E a l s o T h e y o t t h l o f t h a v d o e m S e h a v e x p e e c t e d e r a l , C U E S m y p r e p a l l y o f t e r c i a l o u c a n a c k a g o u 2 o c l a s s e s c l a s s e s a p u n. dp a n p d u p l i b e t o a p p o r o p t h t h a t i t t o D a s a n a c q u y 3 a v a i l a b i n s t a l l r i a t e e w i n t o r a r i e s d m c t i l e t h 2 - b i r e d i t v l e f o r p a c k a g e b y e r s i o D e l p n e h i s i a s d i r e c t o r y . e l p h i m e n u . t o n p e d ( w c p m Package a c k h a c k a g p o n t h e e r e e collecti on i s n y o u r i n s t a l l a t i o e n t s i n pc) , ( * . d a n d b r o w s e t o t h e f i l e s . t h e p v n e r s i o d a c k a g i a l o e a p n o f g p a n D e l p d O e a r o n h i ) o n K t h a n d e CU t h E c l i c k e p S O . K a c k a g of t t a b e i n a l e t t e . i s n e c o p e o u t h o e n t e c i f i c a t i o _ n t w n t y p y l r o m e d h a v i n t o p c o t t o n . e r e exm o u f i l e h h e p o f n i n t o a s w n a l i t y d l e m r c e a r e e n m c o s o u e r e g f r o b d i ni sh T e u s . l e m t n i r e c t l y h i e r a r c h y f u u h e m e c i f i c a t i o b M L a r e a c e s , M h a v h d w u F g . c o D f i l e s t h c l i c k e g A e e l e c t i a l o c o i n c r e a s e d e s p O e c l a s s s p D j e c t s . b a t c h e 1 f o r e r w e e S C o b e Component | Install Packages… f r o i r e c t o r y t h E t h d d i c a n i s m e l n a m y o u t h t h h a n m t h e v o f t t h r o u e l e c t C L I f a c k h M t h i n t e r f a c e s n s S O 3 n p S . h i . t e d . E e r . e l p t el e n O i t h M s U D D M w f o r ing C e l p O e o u O e , o r t o w e r s i o f o p tr o P a b D D l e m a n d t e n s i o p h e u r b C e e x s u T 3 p n a t i v a c k a g t h i m o r r y W s e a r s e r w p w o f p t o i a l s o s e t e h e h m W t h e e d D 4 a t h a t n h a s od d e s c r i b a r e n o t e d e a r i n t h e d i n e a s X f u m t h l 3 O e y b r t h j a r e M e r d e t a i l e n c o u odel u b e l o n n t e r e d . i t . w . U D n i f f e r e n l e s s o t h c e s e r w f r o i s e m n t h e o t e d , 4 A p p e n d Figure A- 1 i c e s T O b j e c : T h e C U E S o f t D O M c l a s s h iera rc h y . t E x T c P e e p t i o n T D T X o m l D o T X m l N am T X m l N o x l P c e p ar se t i o r E n r r o r nt T X E m r si st e T m C o m m I m p p e d d o l e N ne T X m l O b T X m l P ar se m o nt e d j M nt at i o e M X m l N o d e l r n ap e T X m l A t t r i b T X m l C h u t e ar ac t e r D T X m l C o T X m l T e at a m m x X X m l D o c u m e nt T X m l D o c u m e nt F r ag T X m l D o c u m e nt T y T X m l E l e T X m l E nt i t y T X m l E nt i t y T X m l N o T X m l P r o d e L i st e R e p l C m D e at aS nt e nt t at i o c nt m T m e t T T o e f e r e nc e n ssi ng I nst r u c t i o n e c t i o n T A D O M E x G c e n p ep e r a l a c k a g D O p L is u e b n T : T h c st r u ct o r C r o p r t y C od e: d ; e p r o p u c op r T S c o a n M E m C r t o u w l d C h i s n O M o o f x c - o t h : C r i n E N I n c W e c o n s i n t io n oC od e c teC g T y p x S i z t r i n i e r a r o a o o i n o u i n T d X E D g y D e m l erro r c o d es c N o M c N o t F o a t a o t S I n A q u T u m m e e e A s t E n E l l o d o i f i c u n I n o d 5 e l L g w i s t i n c o d i t h i n g e A t o - 1 d t h ) . e n e F C U o l l o o t e w h w E S i n i c h o f t g t h t y p e e o f e t E E n A u p p o r r o d l l o w u s e A t t r i b u v a l i d P a r a O tionC n p M F C t y p t h d ode) g e s e r i n g e s c r i b e d b e l o w : ; i n t h e x c e p i t s p e t y p t i o e n s o f e r r o r o u r s e l f , y r o c e s s i n g . ode; e o u a r e a s s i n d u d y j e c t o f p c a n r o b l e m s e e , a r o s e . t h e s e a t i v e t o a f o l l o I t s w v a l u t h e r t h e D i s O M n r r e d E a r r d E r r o h e E r r A n a E r r A n b m i n v a o i s n t f i t r t e d n t h e o m e c e g i n s o c e m r i s t e o r g r e a t e a n e W w h i d e e S r e t r i n i t d o g e . s n o t u d o s e c d u m e ( u s n u t a i s l l y u s e c o n d . t a i n i n g a n r ) . i f i e t a g c d f o r a n o d e t h a t d o e s n o t . t o i f i e m d o n d o i f y d e a c r e a n a n d o - o t b n l y e n f o u o n d e d . i n t h i s t . t i o t t r i b i n n a a n r t e e s r a t i n c o e s e n a e x a p f r o d p t e p i n h s p n e i s r t m e s i z o s p o t t e d l i d c i s p h T a l t a p A v a r . e i n D w e d g t g o o . x n n x d d l o A r t e o e T t e m b c r e a t e D s ; g e e e n r r r t e ep t i o h a t A i n e A r r l l o n i n A d t i o E xc ea w . e) tion o c e p e r od e; o t t h n h r r r r w a d E n y - 1 ea i s c r o c e s s i n ep E ode s u e M . od l d b o c c j e c t . r r e c C e x o u l e A E R o N a e e b e r i c n xc i c a t e s a b r r i z E e w w tionC e r t y n n r a i s e d ep r o p w M F ode: a M S h l i d e N O ( s e e m t io ad O s u c t n . E e g r c n v N e p n u ep e D i l l e c M l e c r T oC y t h o s e xc p s h a e r a t e s i c a l l y E l y o f ode( e n t o E n o d s N e S I n e e n EExceptionC e b c W O g ex e: od e d H e m tions a a e o c u D ep Error Code c g xc n l y ep e( ea o s e U od c t o r ode: e c i f i c a t i o l e A- 1 c D Exception) e t h r e a c t r e a d e teC d n s t r u ty s p e f t ’ s tion d u D EExceptionC n t e r e d . er T e o ep a d d s O ea c o u u o r tor h i s b b e r t i e s tr e n a E c T T U c o c c u class( p r x i t D = n ons p C : a s n , e T co h e A a r o s e . g A- 1 li i x o t i f i e d TDOMException p d t h a t n e c i f i c a t i o l e m t in e n tion E a r e s p r o b p e r r o r s e M p a g s p d u u n t e a l i d a d p d e a e d c i f i e e l r e r a d r a b n t e r t h i m y a e f o i s d t o m d t h e r o p l o t h i s e l e n e o g m b j e e i n n g c t a t o t i s t i o o n n n o t . e e l e m e n p r . a s s e d t o a m e t h o d . t 6 Appendices TXmlParserError Exception E r r o r s a r ising f r o m t h e pa r sing TXmlParserError ex cept io a b a nd o u t t h e r ea so XmlParser u N O T T h e n b i s li n n o e q : u T i v h a e l e T n X t m = o f l P t h a n st r u rl, ct oU C o x r E c e c r r o ep p o f r t t i o e i x t h n ) eParseError(oF i c on reat r oR eason : r o p e r t y R eason : p r o p e r t y L i n e: I p r o p e r t y L i n p r o p e r t y F i p r o p e r t y U rl: d ; st ru I n c t Bu t i n g st r i n g n r ent e a r e ) . Th indica t ed ese incl u er r o r . de f u Th is cl a ss D s p t h r o u r t h er g h a det a il s a ppea r s in t h e i n e p t h tio e W 3 C O M e c i f i c a t i o n ct o r . Th e . n. it sel f rop ert R R eason L i n e; ad F L i n ad F F i lePos; n t eg er r e I n t eg er r e n g r ad F U rl; r i e C reat oU e a oR cept io eason n du t h : st t ex t n e, oL i n ePos: I n t eg er; ; ePos; : oFi st r ing t h ri a nd y n g o u n o ds a r e l ist ed b n g ) oL i o t h is ex nl y o f eason t h e e, it h cept io need t o FR n oL el o i n w : ePos: ; e pa r se pr o cess w read descr ipt io et h lePos, ri e pr o per t ies f o r ese er r o r s, eason F eParseError( a l l i j ect ’ s pr o per t ies a nd m rl, ex oL F ad I r a ises t h et r iev ad ePos: new R e e lePos: et er s set y r r st t lePos, ; er er; il d a ) st eg or eg pa r a m p e class(Ex p on i s r se A TXmlParserError o b c n m A- 2 c co e po sit io do cu nit . TXmlParserError u a ist ing E r e Listing A-2 p f o r o f n ( see L t h is co n. G r espo nst r u ener a l l y nd t o t h em t h e pa r ser . ; pr o b l em t h r o u g h t h is r ea d- o nl y e X M L do ent y t h is pr o per t y . p rop ert y L i n e: Th is r ea d- o w p rop h er e t h ert y n i n t eg er pr o per t y e er r o r L Th e I nl y w FL i r ns t h n e; e l ine nu m b er in t h cu m a s det ect ed. ePos: ch a r a ct er read r et u I n t eg er po sit io n w read it h in FL t h a t i n ePos; l ine is g iv en b r ea d- o nl y is r ea d- o nl y do cu ent pr o per t y . p rop ert F y Fi ind t h lePos: e o f f set I n int o t t h eg er e X M read L do FFi cu m lePos; ent a s a w h o l e w it h t h pr o per t y . p rop ert y U rl: Th is r ea d- o st nl y ri n g read pr o per t y FU r et u rl; r ns t h e so u r ce na m e o f t h e X M L m in er r o r . TXmlN od Al l t h L e b e C no des w lass it h a sic f u ist ing A- 3 in t h ) nct io em e D b na l it y o O M u dies t h st r u sed b y is in t h ct u m r e der iv o e C st U E o f S e f r o t h o f t em m a . Th pa ck a g co m m e TXmlN e. o n cl a ss t h a t od e cl a pr o v ss ( sh o w ides n in Appendix Listing A-3 TXmlN od e p ct r p n U h e T : I t e e d F N od eI d F N od eN ame: F N od eTy F N od eV f u n ct b li c p n t eg X m o i I t eg er; r n g ; eS t ri n n g alu e: st o n G et N od ct o r C reat i r u e st r u ct p r o p e r t y A t p r o p e r t y B aseN ame: p r o p e r t y C h i ld N od es: p r o p e r t y F i rst C h i ld p r o p e r t y L ast h i ld p r o p e r t y L ev elC od p r o p e r t y N amesp ac p r o p e r t y N ex t S i b li n p r o p e r t y N od eI d : I n p r o p e r t y N od eN ame: p r o p e r t y N od eS t p r o p e r t y N od eTy p r o p e r t y N od eV p r o p e r t y O w erD p r o p e r t y Paren t N p r o p e r t y Pref i x : p r o p e r t y Prev i ou p r o p e r t y Tex : p r o p e r t y p r o ce d u r e p r o ce d u r e f u n ct i o n p r o ce d u r f u n ct i o n G et C h f u n ct i o n G et N od esB f u n ct i o n H asA t t ri f u n ct i o n H asC h i ld p r o ce d u r f u n ct i o n p r o ce d u r e R elease; p r o ce d u r e R emov f u n ct i o n R emov f u n ct i o n R ep d ; sing f u cept io no de. S e cu D est roy t ri u r b C n t im i r r i on st D o h p rop ru t y O b j ect M o 7 del N od ; n g eM G ap et B TXmlN od eL i st TXmlN od e r e e ad G r r i n g r e ad G et r i n g r e ad G et g : TXmlN od e r e ad t eg er e ad N od r e ad F N od et et ev elC od amesp ac G eI ex t w r i t e w r eN ame i n g r e ad G I t eg er r e ad F N od eTy r n r e ad F N od eV TXmlD oc u men r e ad e: TXmlN od ad g n g r : e i n g r e ad men t : st ld e G et r et r F od e Tex g e (oN ew C h eep : B oolean oc u men t y N eTy ld N od es; C h i ld ; i ld ; ri b u t es; e; S i b li n F N od eI d ; t e F N od eN eS t ri n g Ty w i g ; ame; p e; e; alu e r i t e F N od eV G et O w n erD oc u men t ; N od e; b li g ; ad x e; od p e i t t alu e; ; G et Prev i ou XmlD oc u t ; : TXmlN od e; TXmlN od e) ; Ty p e: I n eg er) : TXmlN od eL I n t eg er) : TXmlN od eL i st ; C i : TXmlN od e) ; e ad sS i n ; G n N Paren r t i et r Pref TXmlN G t t h N r g C et d A i N st i h L e: : rst ast p t C i L Ty st F F i men r ad G F ad ame; r n g F e st g n r e ad st r r aseN ad et men ; C h i e(b eO D i ld : n erD ld N od esB y N od b u t es: B oolean ; N od es: B oolean ; i B ef eTy p od e: ew h i p e: TXmlN ld , od oR e) : od e) Tru e: e(w Ty C = od p e(w ore(oN er(oN eA od (oN TXmlN w ef B ; e) h t ld oolean i st ; TXmlN od e; ; ll; eC h i ld eC h i na l it y (oR ld f r o t h r o C h i ld (oN ew C h i t h e b m w n – ef : TXmlN ld , oR a sic no f o r ex a m ef de w pl e, r n a n em od e) C i h h TXmlN : is no t pt ing st r ing od TXmlN en it a t t em pt y : ld t o o r n i e; od e) : a ppl ica b l e r esu l t s in a n a dd ch il d no des t o l if no t t h ey do a t ex a ppl y t t o de t y pe. or no t i ad pl e pr o per t ies r et u c r e n sert C reat et h A a s o ne o f t ed no t ri b u t e a t t r ib de def ined o n a l l t y pes r et u r n n m t h i a TXmlN es dir ect l y od is cl a ss’ es: u des, l. su TXmlN t es o a p co no o ds o f e o od b j ect a r e det a il ed b el o w : e; cr ea t e TXmlN Access t h na m g li od ier a r ch y ert n i d e amed Th e pr o per t ies a nd m c ent ; d b eN lac r r r u t e TXmlN i ef f v st st st en no m n. e: st eing r r ent tio e: sS p nct io r a o cu e od p sA l a f t ’ s D od u lon I o e: A n o TXmlN oc orc e: : e: R I n b p oc p : n d e S c Ty st ri d F e g es: A e d n ; t alu XmlD C e E e; n d o U ; r e: d C er; st i st l N co ex t h T class o u e : = A: f a no nl y amed el em . Th ey a r e o nl y u sed w it h in t h ri b e D O M cl a sses. de w nt a ining o b N od it h t h TXmlA ent no t eM ap read t is r ea d- o ri b u t des ca n co nl y e o b FA t t u t pr o per t y . I t j ect s. Al t h nt a in a t t r ib u es; r et u o u r ns a g h it t es. Al l o t h is er 8 Appendices p rop ert R y B e t h pr ef ix N O T I n p e e t h r o u W 3 C D O ert M y o no C h ld do r ns a no N w y n L n t h r o u ert h t h L C t h rop h , t h o m i i B aseN e – nl y pr o per t y . t h l o e c f od a l ld eL p e do cu m i a r t o : t h u st ent o r der ed no edia t el y ld od nl y ame; t h e pa r t f t h e n read t r ee u des, m pda t e t h is pr o per t y TXmlN od r et u a f t er a ny na m m i s espa ce o d e ’ s n a e g i v e n b y e h ses t h e m read G N od r e, Fi pr o per t y . I t ch a ng a nd v C h in t h i ld e C es t o ice v v a l id l ist , rst ent r y es; nl y a ny ct u r ns a et e f ir st ld t h a t a in st r u r et u i is r ea d- o ea ning st il l r ns t h FC b u t h e er sa . I f t t h a t l ist ; h i ld N es l ist od ch il dr en. : TXmlN od r et u e: st e read r ns t h seq u o u t h g h co u r t h g G e l a st read r et u n o f e seco t h e f o u n ence o e po sit io de a t ri pr o per t y a s a ev elC ert od y p e N r o p T e amesp na m f r ns nu t h m et L ent r y h G t h b e no nt ing ast C h i ld ; i ld in t h e C et e no L elC od e; l o ca t io n ev de’ s er s sepa r a t ed b de’ s a ncest o r s w er e st a r t s a t nd po sit io po sit io r t y ac is b i s n in t h n in t h o st t p a ri r t n e do h if “ x no f t h cu h w y per io it h in t h o ne) . F e no m e N es l ist , od o r de a t o r t h it h in ds. E eir ex e D O nu M m b er pa r ent ’ s l ist a m e f ir st t h a ch pl e, 4 . po sit io 1 . o f is 2 n in t h e ent . W read f o r na m s” mln o g descr ipt o r l a nk g n e: espa ce decl a r ed t h r o u t h g h il dr en, h elC pr o per t y . I t t h 3 G C D et e no N O M s p amesp de co m espa ce a ppl ies t o pr ef ix ed a t t r ib u e c i f i c ac t i o n . e; es t h a f r o e no m t h de. N is a m r ea d- o nl y espa ces a r e t es. E e W ames p rop 3 C ert cu t h rop O R y M er N t co o e t t r i b ex S u i b nv m a y i f i c a t i o n , t h e n n g : TXmlN enience f o l l o od eI d w : b a m e s p a c e f o r t h e n o d e i s g i v e n b y t h e . li se t h is pr o per t y t h a t c t e od ing I n t o no t e pr o per t y , ne in it s pa r ent ’ s l ist er e is no y s p a I N r r ent ert U D aceU Ano t h p et E L Th e p G de’ s na m ne. ev de a t n is pr o per t y r ea d- o e no no p im ch il dr en ( a l t h t h t i o er e a r e no ast ier a r ch y ch n read e no TXmlN l ist C r epr esent s t h O g enience pr o per t y no y Th is T e” rst il a r l y , l if i a es: e l ist nv y im rop e od “ l iv l if i ert n N n t h . Fi S O i f i c ert rop h c t e ent r ies in it . o r T e u de h a s no Th is co I n ri o f is r ea d- o h a s no rop N st pa r t t h s p des in t h a p h t t r i b i v ing r et u p g M localName a rop p – ame: e l o ca l E t h t h aseN et r iev eg t h o f is ch o G ne et N ex r et r iev t S es il dr en. Ag a in, i b t h li e a n e FN i n g ; no de a f t er l is r et u t h er e do read o u cu r o m FN w od n I D ent eI f o r it sel f . d w ea ch ri t no de, od eI d ; sepa r a t e f r o e r ned if de. def ine y e def ined in t h read m a ny Appendix N O T h e p rop Nod p eI ert d y r o N N E S o f t ’ s D eN i s n o ame: t r t ri n st a o f t h g e o cu e. S ee Ta b l e A- 2 M m ent O b j ect M o 9 del 3 C en b D O FN y M od s p eN e c i f i c ame w t h is pr o per t y . F f o r t h e m a t i o ri o r ea ning n t e so o f . m FN od e no t h T T T E R X N y o p d e na m e a nd v a l u e b y no e N T C I B T d e N _ D A U _ T N T N O E O A D _ D _ E ty p e ode N N S N O D E a N E E C m a e o m f e e l e N m e n t ode V “ ” ( E T I O N _ N O D a m “ # t e “ # c E e o x f a t t r i b u t e A t ” m N T I T Y _ R E E N T I T Y _ N O P R O C d a t a - s e c t i o n o ” E S O S F E D E N C E _ N O D E N E I N D R a N G _ I N S T R U C T I O N _ m a T e m a o e r g f o e e f t n e C o M M o “ ” t i t y “ ” f i n s t r u c t i o n n E N T _ N O D E “ # c o m m e n t ” o p D O C U M E N T _ D O C U M E N T _ T D O C _ F N O T U rop M T E N I O ert T N _ y N N O Y N R od N O T T h e p rop r ns t h “ # E A _ G D N O M E D N E T _ N O D E ri nl y n g Ty p e: pr o per t y st “ # ri r et r iev de t y pes f r o m o a c o a e o c m n m e t ” d m o e o g n f u e f n n u e no l e A- 3 m e t - f r a o n t i o G et g t a t m e t y p n t ” e e x t f t i n g t t e n m t e o n f t “ ” “ ” n “ ” N od eS t ri de’ s t y pe a s a a s t ex o l u t e “ ” c read es t h Ta b u m d N t e no d N E eS n g Ty st r ing p e; v a l u e. I t t . E Nod eS ert t r y i N n g od T j ect , a b il it ies. Th rop ert FN R od y a l l o N eV et r iev no e p p p nl y o b co r r espo y eTy Th is r ea d- o p E P O Th is r ea d- o r et u D n d e n t f n t e m a o A c l u o e v t n T r g C t e t e n x l u t y n t i o o e u A c C E c A a sed ) t e D t i t y n g n t a O b a p t t r i b C s e E C is is a . C N ame; is pr o per t y s t r i n A eN des t h e no de’ s t y pe. : E W read pr edef ined v a l u n t h e o f p iv A-2 E r t y de is g ode T L e e no l e E U t h o b p od Th e na m a C E T T A: w od e o r e I r t y n t it t o su alu a n er e x t e n s i o read e sa f el y ca st ne o f t h ri read n t o FN ident if ies t h b e is o b i s eg pr o per t y e v a l u eV p e: ing nding alu r o t h od e eTy e t y pe o f t o t h a t o se sh o w W 3 p C D O M s p e c i f i c a t i o n . e; no de r epr esent ed b t y pe t o y t h is a ccess it s a ddit io na l n in Ta b l e A- 3 , a l o ng side t h cl a ss. e: st n g FN od eV alu e w ri t e e; set de t y pes do t h no t e t ex u se t h t v a l u e o f t h is pr o per t y , e no de t h r o u a s sh o w g h n in Ta b t h is pr o per t y . M l e A- 2 . a ny e 1 0 Appendices T a b N l e A-3 ode T E L A T T E M E R T A o T N T I T Y _ R E N T I T Y _ N P R O C E S T E I O F E O O C U M E N T _ O C U M E N T _ T Y D O C U M E N T _ F R N O T N _ ert _ y et w p ert y rop O D b ert pr ef ix rop ert G et : rop N B O T o p s p _ N O D T _ N O D u men t g t : m oc m X X u x t i t y n r o l C o c l N men t e R e t i o f e e m n e u e t i o n n g I n t T y t F r a c e s t r u c t i o n t t e m n r e n m u t a c s s i n u c o S e c o t m o l D m c m o s t e t a t i t y l E s t a l P n u n l D m e D l D X T n n p e g m e n t read ; r ef er ence t o h m X E TXmlD m m e l E m X X t t r i b l C m X E l e Cl a t h is r ea d- o t h e do cu nl y m ent pr o per t y . t h a t F cr ea t ed t h o r do cu m em , ent w no h ich des is t h is t N od e: a D O t h e no f r a g m ent t h i x TXmlN od e st r u ct u r e, M de. Th no read t h is r ea d- o e pa r ent des, FParen a s w el l read G is n i nl y l f o r o t h er a s f o r t N od e; pr o per t y a t t r ib no u t e, l et s y do cu des t h a t o u m h a v r ea ch ent , a nd e no t y et e t r ee. : st ri n pr o per t y f r o m t h g r et u e no r ns t h et Pref e na m de’ s na m e, i x ; espa ce pr ef ix o r a n em – pt y t h e pa r t st r ing if t h u p t o t h e er e is no y Prev i i ou ou ert y et h t i b b li li n g : st t h v ia g n g t : TXmlN e read de b ef o r e t h is o ne in it s pa r ent ’ s l ist . n io u s no de. read f r o t h is r ea d- o od e no pr ev ri e t ex n ; es t h er e is no e a l l er i r et r iev t h Tex et r iev sS sS m G nl y t h et is no Tex t i l is ; de a nd it s descenda nt s co nca t ena t ed pr o per t y . E t h e N l E l A g . Prev g X T T men nt a in a – r ned if t o I O E N o f ) r et u R D E oc u Th is pr o per t y p T m t i n l. i n ( T T oc Pref l o E E Th is r ea d- o nl y co D en l T X T t h r o u ent y C O M erD e pa r ent m O U N G een a dded t o rop p R _ A Paren do cu N E E D n T nce pl a ced int o t h p O l e r ns n _ m T T P des co r et u E X E E O erD a v a il a b S D N w n no O N O O Al l N I N D G C D m T _ D rop N O m X E G T N l em X T _ E M I O E N R D I N N D T C S p T O O p s. E N C T e E E E A p D _ D S E ty O E O _ M N T N e I m _ U A d e N _ T N p I B X D y E T C : t h c e i f i c rop a ert E x T ex t i o n y t r a ct a t n d X mlD ocu men p t r o p e r t i e s a r e e x t e n s i o n s t o t h e W 3 C D O M . XmlD t h e X oc u men M descenda nt s f r o m L t f r a g t h : st m ri ent is r ea d- o n g t h a t nl y read G et XmlD co r r espo nds t o pr o per t y . oc t h u men is no t ; de a nd a l l o f it s Appendix p roc ed u re A Add a co u O T h e p roc A d d R ed h e re n c t i m A o p en p ent C a l so lon eir du M ed T f h t i t o p t h t o m t h it od o e a c ceO k i n r t ( no e( f is t i w o D t h e ew a T a w n eO h in t h u e p n 3 i u U se a l l B O R j ect M o 1 del t o elease h : en t h e no g i f i c a decr em 1 ent t h de is cr ea t ed, r e, it e a nd f r o n . ; is f ir st o f ch r em o v il dr en. I f t h e ed. Adding a il dr en inst ea d. = l t ing e) t i o de’ s l ist t h is m Tru et h m e) o et er : d, TXmlN incl u def a u l t t h is no pa r ent u od ding v a l u t h it a t t r ib e D u t es TD a r e e pr o cess st o ps de a r e a l so nt il e; a ny es in t h is False, e descenda nt s o f pl ica t e h a s no c od is no it s ch pa r a m e t h h eep s p TXmlN ct u o f M oolean t es r esu t h D e st r u : D C ld de t h r o u e b du w n erD o er t h erD oc b u oc u men e t h ne do G D e ocu i et od et r iev r a o r t Nod f b cl o is pl a ced b ned u a ck nder int o t h e men m ( oN od pr o per t y t e sa m cu t e a s t h ent t o e: f o r e cu a no t h TXmlN t h e r r ent su no od e) ; ppl ied no de a nd de. Th is l et s y o u a l l it s t r a nsf er er . C h eL or i i e a men mp ld st no m t t N Nod e od t h o m e d e esB i s y t h N o n d od o t p a r t o f t h e W 3 C D O M s p e c i f i c a t i o n , . eTy p e( w Ty p e: I n t eg er) : ; de l ist co nt a ining a l l sing t h e im t h e v a l u m edia t e ch il d no es sh o w des o f n in Ta b a l e A- 3 g iv en . E i t h r e O ca l l ed w e end o f t y pe. Th e t y pes a r e specif ied u O ent de. W C t h eep t h e, f oN e no e new m n on R e no de a dds a l l b t h is Tru O t o TXmlN N m e t r ee. de t o es. At t r ib Forc des f r o or i s n N o cu a t ica l l y t h a ld pl ica t ed. I f re et F u f t ’ s D E e t o ent descenda nt s t o u o h ier a r ch y . u no n C m v a l u e co py . Th O d eN er e. I f S b nt d is a u i s co py t h roc O S de is a l r ea dy t h D d f r a g r ea t e a a nd t h h co u o e specif ied no on C N E is a dded t o t h ppl ied no do cu T U ; et h en it m ef u su p ef nt . Th is m Adds t h u R C E T f d r ef er ence a g a in w N d A: eI c t f t h o t i f er on im G et e at G TXmlN S e t h W et N eL il a r l y , h i C ld D Nod O M es s p B e y c Nod i f i c a eT t i o y n p , o e a l t h r o G u et g Nod h t h e es y B f u y Nod n c t i o eT n y p s o m e m e w e h t h a o t d l i k s e . or od C 3 od i esB st y N od eTy p e( w Ty p e: I n t eg er) : ; t h is m et h o d r et u r ns a l ist o f a l l descenda nt s o f t h e specif ied t y pe. f u n c t i on H asA Th is m et h f False w u n c t i on A co t h H nv e l ist t t ri h o d r et u en t h asC h i b u t es: r ns Tru er e a r e no ld enience f u N od es: nct io n, a nd False w h B oolean e w h en t h ; er e a r e ent r ies in t h e a t t r ib u t es l ist a nd ne. B oolean t h is r et u en it is em ; r ns Tru pt y . e w h en t h er e a r e ch il d no des in 1 2 Appendices p roc ed P u re l a ce w it h no I n t h e sert B new no in t h is no ef o v oN im de’ s l ist de is pl a ced a t r em ore( de m o f ch t h e end o ed. I nser t ing a ew do C h i ld edia t el y , b il dr en. I f f t h cu oR ef o r e t h ent f r a g m od e) C t h e h i ld : TXmlN no ent de is n de a l r ea dy no od e) ; specif ied r ef er ence e r ef er ence no e l ist . A new m ef in t h de a dds a l l l, i t h no de e new e t r ee is f ir st o f it s ch il dr en inst ea d. f u n c t i on I sA Th is f u no F N O T de in a o r b h p roc e I s A f ed O T h e p roc f ed w u t i c T R w T h X i s o f t h : B oolean r r ent no e h ier a r ch it s pa r ent a nd a ny n o t p a r t is dest r o t h e no o d emov o ch f y ; de a ppea r s a f t er y , a nd False if a nd a ny il d no t h e W 3 pr ev io u s sib t h e g iv it do en es no t . l ing , b u t it is des. C nt f o r D O M s p t h is no ed. Be su de a f t er i s n eA e c i f i c a t i o n . a dding r e t o it t o de. W ca l l t h h en t h t h is m e co u et h o d o nt r ea ch nce y es o u a r e e t r ee. o t p a r t o f t h e W 3 C D O M s p e c i f i c a t i o n . ll; ch il d no o v et h i m e t h emov es t h t h a t t o e O l ing e cu des f r o m t h e l ist a nd dest r o y t h e no de o b j ect s. o eC h de R em o ep v i is o d is f inish od i s n ld o ( t p oR e specif ied no no on d lac r et u a r t ef C o f h i e W ld de f r o r ned. t h 3 : m C D TXmlN t h is no Th e O o l d no M s p od e) sh o u c i f i c : de’ s l ist de e a t i o n TXmlN . o f l d od e; ch il dr en. A r ef er ence e r el ea sed b o nce t h e ed. eC h i ld ( oN ew C h i ld , oR ef C h i ld : TXmlN od e) : e; e t h e specif ied r ef er ence no nct io n r et u r ns a po int er t o de a nd inser t t h e no de t h a t t h e new is r em o no de in it s pl a ce. v ed. E l t h or t r a v er sa l t h e r ef er ence co u t h ll on Th e f u n d j ect e R eA em R D m re emov c n o TXmlN e if de is a f t er sib o it h e TXmlN d e: E m O t t h e o b el et e a l l R n N no t h ent f inish t o A od r ns Tru elease; t h eleas T u e R ecr em R f a nex m er re ed e u pl e, z er o , R O oN pr e- o r der a m t u D h er( n r et u E T N ex ef o r e a ny D T t E T N f nct io s M u g h i n t h c L l u e v mali i l e mlD i omI C e e z s e d l 2 u mp E p v o p e or S e s p d e S U s e e s o l c i f i c a t lemen f t r a p p a r o a e i k e n r i n i s at c p t i o a ed t p p d on a g e r t i e a c l a p o d r e t h u d s e e a t h e l i c s s . a T t e e X s n o l i n g n or mlE d b t w e x l i c i t l y n mali lemen y p i t h t h e z a e c t H s u m e a l a as p s p n d s s F p a i c o s S u C u D s . i n eat r t e r O M p U e M L p i s s i n or E t m S e o e e m ed d 2 , m e p o l f r o f t ’ s t h v g t h a c o i t t h f k o a d e g s . e t h , e Appendix TXmlN od eL Th e ist C TXmlN co l l ect io no de, od n o f a s w no Listing A-4 TXmlN od p c u e b n li : i ct st eL T n r u d e st r u ct p r o p e r t p r o p e r p r o ce p r o p r o f u f u p f T L en t y XmlD d u r e A d ce d u r e D elet ce d u r e Emp n ct i o n Ex c h n ct i o n I n d ex r o ce d u r sert u n ct i o n f u n ct i o n p r o ce d u r e R ep p r o ce d u r e S ort d ; ru c no rop F t h f o p O T l l t h e D r m e p O a r o p M n eg er oc u men t : st (oN od O b j ect M o 1 del 3 L ist ing j ect r et u et N e c r ned b od po sit io A- 4 y t h m e* ) enca psu e C et h o h i ld N l a t es es pr o od ds. I t em a n s w o r der ed per t y it h in t h o f e l ist a a r e n. l a r a tio n. d e r e ad i n g r TXmlN od e) ; ex I n eg er) D est g e(w S rc f (oN od e: r ; i d r n O M ov r : t G et e ad L en G g t et h ; XmlD oc u men t ; oolean ; ; I n d ex : ex : I n S rc , w D est n d ex : ri b u e: d e(w t I t o b st m i ld g t e nu I N t eg : I t t eg er; er) : : I n t eg n t eg er; r n I st i er) n : eg od e: TXmlN od er) : B oN od = g B t oN eg n er t o e indiv cr ea t ed f o r es pr o od I b n e) ' er; TXmlN oolean ' od e) ; e; e: ; ; TXmlN w O rd od er: et h I e) ; t eg n o ds a r e sh er = w n b o 0 ) ; el o w : e; : m n t a t ica l l y h I od j ect ’ s pr o per t ies a nd m reat t o : TXmlN n (sA C w (w lac i , I e(w en e ; an h v I y eL o e: e(w t em(w e L i p r t i e e u ert X v l a e t i n y s l a 2 M L g t h f r a g roc ed u ent re Add t h roc ed R u eg f idu roc D ed u o v re d y o u a s t h e r esu l t o f a q u er y , o r t h r o u g h per t y . er read G ent r ies in t h a l e d it em D ( d s w s . l i s t , t et L en e l ist it h od e( g t h t h r o u index g ; h es in t h t h y r ri n t t h n a g f o e w L en i f i c n r e a a g d t h el l - f o r m t t i o t h is r ea d- o e r a ng g G et e it em ed X t h d od e) e end o f ex : I n de f r o t des f r o m t h ; t h e l ist . eg m e l ist . er) t h ; e l ist . a h n i n read ; e no r c r ns a l l TXmlN de t o p s p e l ist . e indica t ed no t e no t e e r et u is I c h t h st e: w x T o : I t e n de in t h en no Emp el et es a l l o t i o e men oN elet es t h d t h a pr o per t y ent . d e i f i c o u t y pe no A c n oc m m e nl y e g iv re em n s p XmlD el em p ent e; t Th is r ea d- o p m e z er o nl y pr o per t y . t o L en g t n s i o h – E rop p o cu . 1 A f t ’ s D ( see List d n n ind t h e ; d Access t h d I t L o : or y o s G eir h t de’ s C ert l N t h g ist s a r e a u a y roy I t e o b est I od b reat r e S class C o E e v a r io u m y st is t h t h X D L N y r on p e = o Th e TXmlN c des. I t h U cl a ss st ent ia l l y st co i a s b a ccessed seq u C lass eL el l A: M n i n t e i t e m d I n t t i o s o XmlD u oc s in t h L u n em a r e a l e l l y e f t x o t e u t m e n s t h t o o d s t . u men e l ist nl ess t h t ; a s a er e f o r m is a a t t ed sing l e 1 4 Appendices f u n c t i S on w Tru u n c t er w i F roc on ed P f u n I n t an i r et u d ex O u n t h re sert on it h t i I n t w if oN od f D t w o t h e e: est : I n t eg er) : B ent r ies in t h e l ist , ex cceeds, ch a ng w TXmlN t h e su w I n d I n d ex ex e l ist . I f : t h b e f o u : I de a t I in t h od e) : e specif ied no de ca nno t ent r y M v ov e( w S rc es a n it em n oolean g iv en t h a nd ; eir a l o ca t io ns. A r et u False r ns n t t eg e l ist eg er; iv n t eg it h it h : er; in t h od is f u e: e l ist . A – od e; n, g iv nct io e is o u t TXmlN n in t h TXmlN t h v a l u oN en po sit io er) w I de w v a l u 1 e is nd. t h e g e index o t h ise. er w ed u re em no o R v ep w e( D est e l ist nct io lac es t h , in t h n. Th e f u roc , f n o ( l o ca t io R p ( e no em( in t h o roc rc e specif ied no I on M p S o f r a ng od e) ; e l ist . ing e, t h t h e it em e f u ’ s po sit io nct io n r et u n r ns l. i c w ns o r ns f r ned if u w f e( e Access ea ch n g e po sit io l a ces t h c h ise. inds t h r et u p c v a l u e o t h f Ex a ps t h e po sit io w n r et u I e it em : n d cu I f r o n m t eg r ns Tru ex er) it s so u : I r r ent l y n t e if eg a t : B oolean r ce po sit io t h e m er; t h e no oN m o v od ; n t o it s new e su cceeds, e: TXmlN ina t ed index dest ina t io n a nd False od e) a nd pu ; t s t h e new de in it s pl a ce. ed 0 u ) O re S ort ( sA t t ri b u t e: st ri n g = ' ' ; w O rd er: I n t eg er = ; r der su t h e ppl ied, no t h des in t h e l ist e no des so r t na m e is l ef t l a st pa r a m b l a nk , et er t h t o b e no so r t y w it h t h t h e v a l u des a ppea r is m et h e o f o t h a t in o r der in a scending ( 0 , d. I f t h a n a t t r ib a t t r ib o f t h eir u t e. I f t ex e def a u l t ) o f el em u t co o r t e na m t h e is e a t t r ib nt ent . U u t e se t h descending ( 1 e ) o r der . I f ph o TXmlN t h nl y t h a t amed u t pr o v e it em a ny TXmlN amed p c u b li N st s b : N T co n r u d e st r u ct p r o p e r t y p r o ce d u r p r o ce d u p r o ce d u f u n ct i o n f u n ct i o n od h ct t h T ap r C D L it h = h o u a i ld t no m e N es it h t h d ist ing v t h t h o od a f f ect ing em n, o f d N des w a n in t h e D O ) a l so e D M M a A- 5 t h is is m e no e ia eir na m er el y a co des. p d e c l a r a tio n. e; roy ; en g t : I n e A d d (oN od r e D elet r e Emp t G et N amed I n ex o v t e: e(w e r eg d r ; i d e r e ad er G et od e) ; ex n eg er) L TXmlN : I I n t t em(sN ame: st r i n od TXmlN od e) : en g ) : I n t h ; ; ; O f I (oN e: ent , M . F t h o r en so r t ing o t h er l ist s, ier a r ch y . g TXmlN t eg er; od m a na g es. Al t h class reat h O lass t h po sit io l N C a l cl a ss ( see L ap est d w o r der ing m y e ap C eir X h t h e a ct u a ccess t o l a r e r eM a r y y eM o o is eM od pa r t icu Listing A-5 l ist is so r t ed, od amed r et r iev de l ist ides pr im im pl y no r eo r der s t h N Th e TXmlN b e y sica l l y e; nv o u es a g h l ist y o u o f no des, ca n a l so enience a nd do es no t Appendix e n p r o ce d u r f u n ct i o n f u n ct i o n p r o ce d u r f u n ct i o n d ; I n I t em(w R emov e R sert e S ep et el o w c on st I n d ex : ex : I n amed N od e(w n d eN d amed I I t ru A t N c t t ri ot at m or no b i ert R y roc ed N O T T h p A e c d , d i f i c roc a D u g t h e nu A d d o ed u R n c t i D v n t h a O s p c t p T i G n d i f i c t N st g r TXmlN t h e: od i oN od : od e) e TXmlN O b j ect M TXmlN od e) TXmlN od e; o 1 del 5 ; e; ) n er; de m t h e: : TXmlN TXmlN amed eg e: a ps a r e a u e TXmlN t h e TXmlD r espect iv t od d N od od od e) ; e; eM o b ap j ect a r e descr ib ed er read G e m t h t o m a t ica l l y e cl a od oc u men cr ea t ed f o r ss a nd t h t Ty e En e cl a p t y i ss a l l t o u i r et u . Th e es a nd r n no de e no de t y pes. ent r ies in t h TXmlN E mp w I I n t d od e) et L en g t h a p t h r o u ; g h t h is r ea d- o nl y pr o per t y . ; e l ist . m y ex de a t y e t h o d s a r e e x t e n s i o n s t o t h e W 3 C D O M t h : I n e g iv t eg er) ; en po sit io n f r o m t h e l ist . An o u t o f r a ng e ; e no des f r o amed es t h n r n t h I e no no d O em( de f r o no ex t b f t h sN t h a t ch oN od r ns – e m t h st ri n a pping es t h is na m g ) : t h a t TXmlN h a s t h e g e. Th e r esu a ccess it s specif ic a b e: n o f e l ist . ame: cl a ss t o ( n r et u m m de m e po sit io nct io t i o ed c ex a u O t i t a f n TXmlN e g iv od en no e) : I de in t h n od iv e; en na m l t ing no e. A n de ca n b i l is e ca st t o il it ies. t eg er; e l ist . I f t h e no de is no t f o u nd, . 1 re o f on r a ng d I I n sert e new r a ng I t n e, ( s w e, no er m t I n w I d ex de a t a n er r o r em( Access t h o f n e t h o d s a r e e x t e n s i o n s t o t h e W 3 C D O M . l a ce t h o u n n o f e( t h et on e f u I c P u e: eg od oN TXmlN ent E roc f : m no r ed. r ned if et u e e od t o f eir er n e no e a l l et r iev t h h n ese no I oN elet Emp v on R N I per t y it s a ppr o pr ia t e su T er; ame: : per t ies o f b e, e t h is ig o r et u u eg o cu . re em R f f t ’ s D er) ds o f t h : m ( elet re em roc u en n index f t e specif ied no de t o t i o ed R p o E e s p n eg e(sN ex o S e; nt a ining re Add t h s pr o on r n t h u reat es pr o t L et u C de l ist s, u a ps co rop p I t em(oN et h E : As f o r p U n Th e pr o per t ies a nd m b C (w I lac N A: n d ex n i l is r et u I : n pa r t icu o ccu e ent r ies in t h a : a I t eg l a r er; oN po sit io od n w e: it h TXmlN in t h od e) e l ist . I f ; t h e index is r s. n e l ist r ned. t eg v ia er) t h : eir TXmlN po sit io od n. I f e; t h e su ppl ied index is o u t 1 6 Appendices f u n c t i F on t h roc nd, ed u D O T T h f re R r n a ep R n ep c t m lace i on T et / S S g f r o et / e t h et N o t h li d st it h no t h ri e g n g iv de is r et u ) : TXmlN en na m od e; e a nd r em o no ing r ned. I f m a t ch v e it f r o no m de is d. ex : I n t in t h eg er; oN od e: TXmlN e specif ied po sit io is r a ised if t h e index od e) ; n a nd inser t is o u t o f r a ng t h e new e. t h n t e x t e em( s i o oN de t o ex n t h ist s w n od t o t h e: W 3 TXmlN e m a pping , it h t h a t e del et ed no e u D od e, O e) sing na m de is r et u C M : it s N t h s p c i f i c TXmlN od od t h no er w a t i o n . e; ame a eN e new r ned. O e s t h e index de r epl a ces it ise, t h e r et u . I f a nd a r n v a l u e is t h e D O M s p eNamed I h a v T t h e i f i c a t i o e n t h e D O M a o d w ese r epr esent T = c r e s t h a b o e v n e a m e s p a c e - a w a r e v e r s i o n s o f t h st ct X u il l t h e t es a nd ch il d no m l E l e m e nt d e c b e TXmlElemen el em ent s f r o l a des a t t a ch r a tio ed t o od e) r r i d e st r i n g r e ad G et Elemen oolean r e ad F F u llEn F I class(TXmlN m o b t t h e t h em X j ect s ( a s sh M L do cu m o w n in ent , a nd . n. o C r reat e; co n r u d e st r u ct p r o p e r t y Elemen t Tex t p r o p e r t y F u llEn d Tag : B p r o p e r t y I g n oreEn d Tag : w r i t e I g n oreEn d Tag ; p r o p e r t y Tag st r i n g r f u n ct i o n C reat eC h i ld C D at aS f u n ct i o n C reat eC h i ld Elemen f u n ct i o n C reat eC h i ld Tex t f u n ct i o n F i n d Elemen t (sN ame: f u n ct i o n G et A t t ri b u t e(sN f u n ct i o n G et A t t ri b u t eN f u n ct i o n G et C h i ld Elemen f u n ct i o n G et Elemen t sB y Tag N ame(sN ame: f u n ct i o n G et sB y Tag N ameW i t h r ) : D o est r F ame, N roy ; ame: o v Elemen t t r, sV alu at c h p M Ex e : t sA B e t t p r o ce d u r e p r o ce d u r e f u n ct i o n R emov eA t f u n ct i o n S elec t N od es(sQ f u n ct i o n S elec t S i n g leN p r o ce d u r S A t t ri b u t f u n ct i o n t t ri u t eN d ; st r i n g ) : e(sN ame: st r i y Tag i N n d S R emov t t b u t e(sN t ri u t eN p od A B : i N ) : e( g r i t r: : r i n g ) : u ery : st r ame, sV alu A t i i t st ; aS ec t i on st ; ; t t ri ) g b : u t e; TXmlN od eL od eL st ; i i ; = F od eL i st ; b t e) : TXmlElemen t alse) ; ; g TXmlA t g ) : r i n g TXmlA t t ri n t ri od st i Tag ; TXmlN TXmlN TXmlN e: d ; t n : ) n ame; ; : eL eN od at ) t llEn t r u u D st g F TXmlElemen g n F ; n i ) n t r: F g TXmlA od A t i e t Tag TXmlC : r b st ew ) r ri ld e(oN n ame: e(oO e(sQ e i ) g oolean st t r st n t r ame: i i TXmlTex st t st r ; r d st g t w TXmlElemen TXmlN e: ery e(sN n ame(sN g ac od u od : ame: d b ) : A A g i ) e(b et n r z b i g ormali ri r w st n Tex Tag oreEn : st sB n t i t d ame r N eA eN g (sTex : (sTerm: n od t on o N on ressi i et i ad (sElem: st ct e st e: n r F ad ec (sTex t u S ; oolean od f e e . lass e a t t r ib : e em m t c sN n I en no ) . Th TXmlElemen e n a e no des in t h Listing A-6 b I ame: w t h a t r r ent l y i s a l r ea dy emov A- 6 t y pica l l y u d amed e g iv m R o f ist ing p w sN E o st L e( de cu TXmlElement C M e( a pping l. i i s s i n G od l inst ea i lac r ef er ence t o n O n e no a n ent r y N N e m de in it s pl a ce. An er r o r Adds t h M amed E e u eN de in t h r et u el et e t h no N emov e no e l ist . A r ef er ence t o f o u p R ind t h ) eL i u st TXmlA t t ri b u ri b u e; ; ; ; b u t e) : TXmlA t t t t e; Appendix Th e TXmlElemen c on st ru E t l em C C p c rop or ent reat e; no des sh eElemen reat eC y h i ld N O T h E e p lemen D O rop M t L e T v ex e ert y llEn S t h et l Fu pa t ib il it y y g I n g e t h el em y et c t i o on el em sa m o b u C C D u r c n ri o m ent e et h n g t h b t M o 1 del dir ect l y . do cu m el o w : I nst ea d, ent o b 7 u t h e o r t h e de ch il d o j ect se ed l a t er . G e v a l u l e t ex j ect o ds a r e l ist ed b e read r ns t h sing O cr ea t ed n d descr ib et Elemen e o f ch t h il d, it t Tex t e sing l e t ex r et u ; t no r ns a n em pt y f st r ing . d m reat eC ec ing e t o n or eE n read d T p ag FFu e o u : ) . r o p llEn t pu e d o f r t i e s Tag a f u l t ) , a n l e in X M pr o per t y a ppl ica t io oolean t def a u a v a il a b Th is ist ing B e nt a x a w r e ri l l n o t t p a r t o f e cl o sing el em L ca n ent FI g n t a g t h a t ( pl a cing b e u sed ns ( specif ica l l y read Ag a in, t h b u t st sh o u oreEn ri n i t h r o u ld C on d H en sl a sh t o m TM w h h a s no a Tag w a t a int a in L ) . ri t e D g h b read t h at FN eN ent ec t i on ( e o m it t ed ent ir el y False, is int ended t r u ame t h r o u ame pr o eN aS od b is sed in a ny e el em od t o it pr o per t y e u new C D w g e X ri h t t h M w h f o r L e ich u do cu FN od a l w se m if a y w s it h ent . eN ame; is pr o per t y . I t m a ps per t y . sTex ATAS r ef er ence t o t h y is l t , t : st ri n g ) : ; a ed b g e o f e end t a g def a u l d no t er it ed N i ses t h t a g . e na m h u By , t e ca Tru il dr en. r ning w g f o r ce t h t a g e ex n cr ea t es a l l o I ch e inh at f o L t h r et u d oolean t o no e t h aS n en False ( t h Tag ame: nct io e t h h end nt o a . ; TM N , ag o r t h a nd sy so h a s H ent , j ect , eat m t t c t h eC o on h d i s C el em ent , on C t h e C reat a n A p p en eC d at o eC aS t h p i a ect r t ld o i f , on t h e t h D C C h A ect io n no e new TA i S no ec t ca l l ld Elemen r ns a po int er o u h i ld r eceiv e a Tex t ( M t a nd r et u eC eat O n a dds a ca n ea sil y r D nct io y o u y D n is f u reat a st l y , Ag a in, C r e reat il a r l y , i ld a im t L e i S f o cu i o de a nd a ppends it de. Y m on n t h o et h u is no t o o ca n a ch iev d o n t h e do cu t h e e t h e m ent de. E e n st o pening Tag r et r iev Th is f u f et h Tru . W it h a n Tag o r TXmlC ex b o m n B is pr o per t y ener a t ing ert w d T : e sh e ent dir ect l y T no t r et u t i o t o oreEn ener a t es S T n d a Tag L t h oreEn et t ing rop O : n i f i c d M m g n X co g h f t ’ s D ; ses t h o f t h N o o d t t llE c is pr o per t y end S T S er e is no u e Tag e ert F llEn d il dr en u FI u Tex t h s p t h rop f et h pr o per t y , t 2 ener a t ing ch p t ent . I f FFu g p l d m Elemen nl y E E e t h U o u t Elemen t h is el em C j ect ’ s pr o per t ies a nd m C Th is r ea d- o T o b t reat ert A: ( eC L e h v e i l t o it . sTex t lemen st e c ri n g cr ea t ed el em : st e new ri ch n g ) il d t ex no , t i f i c a l y cr ea t e a nd a dd a t h E s p sElem: new r ef er ence t o ld 2 a t i o ) n : d C no no eat de t o TXmlTex t r eC h TXmlElemen ent : n i ld - . de w de a s t h e r et u it h t t h t e cu ; r r ent ; t h is m r n v a l u e. et h o d. 1 8 Appendices f u n c t i F on Fi ind t h t h is m N O T T h f m et h a t ch F n i c n t d no i on G g n c t i c t i O T h im G e f c u G et A t h e u G C a t h n b f u st is n ri ent n sea r ch ) : TXmlElemen it h ed l is r et u i g no de w t h in e g a iv t ; en t a g pr e- o r der na m e t h r o u t r a v er sa l . g I f h no r ned. ri e( sN u se i a r t o f t t h ame: t h e st e e st r ing u ld p A t v a l u D O ri t t h er e a r e sev M n ri g b ) u er a l co e o f t h L e v : t l st 2 s p ri n e g c i f i c enience m e na m a t i o n . ; pr o per t y es nv e t o et h o ed a t t r ib dea l ds t o u t e, w it h a ssist o r a n y o u a n em . pt y nd. eN od a t t r ib e f o u st t t e f o u b b o l d t es, b n u nd, e( sN t e no it Elemen ame: de r et u t sB st b y r ns n y Tag n g ) e : w TXmlA it h t h t is t m ri b et h o u t e; d. I f t h e l. i N ri na m ame( sN ame: st ri n g ) : ; e G et Elemen t sB t h y Tag e el em ame m N et h o d, t h is o ne o f e nl y sea r ch es ent . lemen et od i st t h e su is no b on G alu e: o f o B y T ag m Name e t h o d i s n o t p a r t ri n o t h D O M L e v e l 2 t sB y Tag N ame( et a l l it h t h e el em t h is f u e su er b ri n en na m h t g v a r ia t io g ame: st g ) : ent s w it h n. U se a nct io e l ist a g iv en na m na m e o a ppea r f in t h e t h “ * ” a t t o e sa m g a r e descenda nt s e o et a l l r der el em a s a ent s in pr e- o r der t r ee. Elemen st sN ; f t h o k s t h r o u iv s t r ee. Th e ent r ies in t h er sa l i t Elemen eL de w t T E . G sB ) n o a l l y : Tag N ameW TXmlN n t h e od G et a n a t t r ib t i h A st u r et u t e w t t ri t sB y r ning it h b u t e( sN ame, sA t t r, ; Elemen descenda nt s, e a nd a l so i eL t h Tag t h N m ame o se el em et h o d, t h ent s t h a t e specif ied na m is h a v e a nd v a l u o ne e t h e e. E G e et l 2 c t E lemen s p i e m ed C u o S M t h c o e g y T h n ag , n Ex d NameW o p r en ex a t ch z ch a r a ct er e t o b b A d e d h M A at on ( t t ch r E i x b u p t r sTerm: s st descenda nt s pr essio n, a nd r et u b o r der A t ex t p ac d no d p ac e: pa r a m b et w o n t o e ) t h : o d o t b p e t r a v el em nt ent s o f ses o f t ex eL t h e D i st no O M ; des l ist . Th eir t h e h t f f o r t h a t o r der ier a r ch y . ; enea t h ca u o . od ent False) t r ee b e r t w nd a s a er sa l = a l o TXmlN e b n t h o se f o u Tru co i s e g e ent ir e su t h d oolean et er een o m f r ns t h B t h on pr e- o r der des in t h e pl a ced S in a e i ri e eir m e es t h e( S t e es es t h ormali t h i t h ressi ine a dj a cent et t ing i s sea r ch iv m N B t i o at e l ist b s a et h re m t i f i c m a t ch in t h roc c on Th is p h l ist c e n a i s u r ns t h i t a in a g v C t h l o e b u t t h ld n Ano t h L ri ent ir e o f sV O t r ee edia t e ch il dr en o f on t r a v h b d co u t eL t o i t i o i O N et m TXmlN T ame: el em nd, o ca nno t od il a r et c u su t h t e ca nno t e im i f i c n f sN E e s p t o u it on t h N e e ne r et u TXmlN S t y if on a t t r ib n m A h Access T ( de is f o u ent ’ s a t t r ib Th is o u Th t et o u st r ing f t descenda nt d. lemen el em u Elemen o ing E Al t h f d E e u n e f ir st t h is el em a n ex t r a no des ent . spa ce t h a t a r e Appendix co nca t ena t ed. D pa r a m N O T I n e e p D O M L e i n Nod roc ed u R t e e re em o v r f a R v e c u n c t i on R R em m u n c t i R 2 t v s p O T h L f p n l eA m t c n t i b u t h e e A t u m ent O False a O b M j ect f u M o nct io 1 del na l it y . H nd ca n sa f el y b e o o m w ev 9 er , t h e it t ed. n , t h e Nor e f u mali z st ri n c t i o n a l i t y h a s m o v e d t o b u t t no ri e( it h b sN t h ame: e g iv de is no t u t eN en na m f o u od e( oO u t e f r o n g ) e u ; sing t h is m et h o d. N o t h ing nd. ld A t t r: TXmlA t t ri b u t e) : e; t N a t t r ib o 5 ent , od l ist es( f sQ a l l ) . Th S t h a es i f i c a t i o u t h no t h e el em ent ’ s r ned. I f t h e g l ist iv t h r o u en no g h t h is de is no t a n h a ppens. : st ri des t h a t r r ent l ist m de is r et u ery e no e cu pt y o n S no is r et u n g m ) : TXmlN a t ch t h de a ct s a s t h r ned if no m e g iv od eL ing po no st P e st a r t ing a t ch i en X ; a t h ex int f o r pr essio n r el a t iv e des a r e f o u nd. t S A t is m se t h f A t ri u et h r ned. O u m e u t e( sN u t e w s o e od u t eN e( t h oN : t h o st ne, sV it h nt ent s o ri b ery io u ame, b a l l . t sQ ri d s a r e n o t p a r t o f t h e D O M b v er w ew A t alu is m ri u n t ) : st o d. Any r: TXmlElemen r ns o e: et h r it t en b t g r et u y ri t h nl y n t h e f ir st ist ing a t t r ib g ) ex t t ; ent ; e new TXmlA t el em v a l u ri b u t u t e w e. Th e) it h e v a l u e : e; d t o v a l u t h a dd a t t r ib e. Bu is m er w il d y et h e na m t h e( pa r sed a t o e sa m leNod ne. a n a t t r ib t b ef o r e ca l l ing t h g t h er e a r e no e h a s it s co pl e st r ing it h n t e o ppl ied is no t U i l if i et n od su t i e pr ev e na m S S e t h et t elect leN e sa m on S g t h i d . d a ct s l ik e v a l u TXmlA n n elec re et t e, ise, o d. Th in w it u r et u h t es t h a t o u r a t t r ib e new ich h a v u no st r u de a nd r ef er ence t o ct u r e b a t t a ch de r epl a ces a ny ca se a r ns n e int er na l t e no ex t h ey o it s ch ist ing nd a il dr en a t t r ib e del et ed no u t e de is l. i E r g n t h t c o r c T Nod e nd, ed r s i o m ri e el em elec f o u i s s i n e t i o t e w ing t t h a pt er on r et u v a specif ied t h es a et h w O f no t h ing Th is m b N i f i c t u a t ch eA ri t e o f S s p sim M o cu st a nda r d D e o u on 2 S u v a l u t h a t elect e roc f f t ’ s D is no t l t c e a t t r ib a e et r iev S v u o E e e S o d. A r ef er ence t o ( see C N E so e r ef er ences. An em T U . emov t o et h a t t r ib f ing def a u emov e t h TXmlA l e h a ppens if f o h a s a C E t h t h et er A: o i a s d b b o s u i l i t i e f t h a t es s f r o e m r e e n n o d o e m t h t h t o d i m m a s p p e a l e p D b r o O o m e v M v i d e s p n . A t e e s e c d l s o , s i m , a i f i c t h l t h i l a r a e t i o h o u i n g as f o n i n A h t r m t h a c t l u r d i e b t i o I n . e u t h n e n e a t d ex O n f d a m h e m as s p e A a t t h c o t d r e i - a b w o u a f t r e eNS t h e 2 0 Appendices TXmlA ttrib At t r ib u u o do no t sib l ing s, o n t h f o r m w so t p c e b n c : T h e b u t e ct o r T C u st r u ct p r o p e r t y N ame: p r o p e r t y S p p r o p e r t y V alu e: f u n ct i o n C lon eN d ; D est ec i pr o per t ies w on st ru c t f ; st r i ed : st r i od m C rop ent ert y N rop ert y FS ec o b p o d e c od e) e r r i d e ; v e r r i d e ; r e ad F l a N od B oolean r e i n g r e ad G et e(b D eep : B et h o r a er h t h t h a n a ppea r ing ier a r ch y . Th eN tio r n n ey eir t in t h h a v l. Th i e A U ri b u t ese l ist s, e no C t pa r ent E S o f t es t h ey a nd no def init io n ds o f F N S od t h n. ame ad oolean e p F w r i t e ec i f i ed eV alu e = Tru e) TXmlA w r od eN w r t e F S p ec i t e S et N od eV alu e; TXmlN od o e i i : t N t ri i b u ame; t e; v o b e f i r ed r j ect ; d ; e a r e discu ssed rop o se the t h r o u st i i g C reat o f h t h eA t t cr ea t ing t h e S t h e a t t r ib et ri b u a t t r ib A t t ri t u b f a c to r y e t es y u t o u m e m et h r sel f . Y et h o d o f FN od eN o d o u o n t h e ca n a l so a n el em ent i R V N eV ea d o r w inh er it ed N ca u ses a ny w em it h b j u st ed r et u M t h h cl a sses. Th e b FN od od eN ame u ame pr o eN oolean w ri t e t h r o u read t e g h t h ame; is pr o per t y . I t m a ps per t y . FS p ec i f i ed w ri t e m e if ent t h e v a l u it sel f e der iv o r es f r o w m e f o r t h a s set a e a t t r ib u t h r o u def a u l t g h t e ca m t h e V e f r o specif ied f o r m e pr o alu t h t h e per t y , is a t t r ib u t e st od eV ch n g read e st r ing alu e su v a l u t h ppl ied N od t . O at M . t h eV alu e a t t r ib h a s t h u e sa m t e t o Th e r ef er ences a r e ig erD D et e o f e a t t r ib t ex ata C t G pr o per t y il dr en o f e e ri e w ri t e e; r it e t h t h t h B do cu e: alu arac it h in : e v a l u aracterD w er it ed N r ns Tru L edded ent it y Th e TXmlC read e o f . alu od g ; e X TD n e na m e inh f ed ri t h t h ec f e D y et des u em set nt o p i o f ert S e; inst ea d t h e o r S dy in t h b te j ect a nd False if su u v ent s, Th is pr o per t y b no h pr o per t ies r et u o g m ame: et r iev dir ect l y h t h M g j ect . R TXmlC O o n reat el em inst a nt ia t e o b p e; roy a nd or f o r do cu p nding des. O D r o u : As p a l l e t h . l Attr ib reat r e r m no t class(TXmlN d el o ent s a nd a r e a v a il a b e no r m A- 7 X = n o t h e co r r espo ri st o f ist ing co Th e b t li pa r t t h Listing A-7 el em e TXmlElemen a n in L TXmlA u lass t es a r e a t t a ch ed t o pr o per t y is sh te C b v a l u u t e w it h t h e ef f ect . S is pr o per t y . Th e et t ing e e disca r ded a nd t o t h e is no t pa r sed b a t is v a l u e r epl a ced a l l , so a ny no r ed. lass a cl a ss ( see L ist ing I t ppl ies m su a se cl a ss it sel f do co es no t m o A- 8 n a ppea r f u ) is t h nct io in t h e h e b na l it y a sis o f o r ier a r ch y . f a l l t h e t ex t u v a r io u a l s Appendix Listing A-8 TXmlC h p u e : arac T t h a r a c class(TXmlN p e r t y D at a: st r i n g r p r o p e r t y L en g t h : I n t eg er p r o ce d u r e A p p en d p r o ce d u r e D elet p r o ce d u r e I n p r o ce d u r e R ep lac eD at f u n ct i o n u b t n D d ; h ert R y D et r iev rop ert F y L ed u a: g re A p p t h co ined t ex roc m b ed u R e re em o su D v r a N od eV alu e ad G et L g g F e en w r t i h ; I n t F e N od a: st r i n f set , w C ou t eg er) ; at a(w O f f set : I n t eg er; sD at a: st a(w O f f set w C ou n t : I n t eg a(w O f f w C ou n t I n t g at erD im st h : I er en d n n o D f r o elet eD e t ex t t : a( ns, FN od o f t h er t m t h at a( alu r n i er; eg er) at a: e D t h G O f st a r t ing f L e w en g t at : st et h e; n g ) o f r n r i ) n g ; ; g ds a r e l ist ed b el o w . z er o . e h st i o t g ; a: a t ri h a pr o at ri , m 1 FN t h od eV alu e; is pr o per t y . ; per t y , w h ich m a y b e z er o . ; t h e ex ist ing v a l u e. R et r iev e t h e per t y . set f r o alu et end a pr o at 2 del ) g sD f f set s st a r t eV e D st e o e no de t h r o u read t o w : a l l read sD t ex eV j ect ’ s pr o per t ies a nd m co nt ent eg o ; n ch a r a ct er s in t h at t t t f , ent a t io g e t ex set b pl em ri t h b a o at M , M n. f D ) tio at ppl ied e t h l a j ect O m Add c b a(w t e nu e e) O a(sD set en ind t h roc at d od ad r ta ent at O e o r a m at t D r D o cu D ri er f t ’ s D eD sert arac t h e o t h e te o l C c S S m o S E = r rop p X a li Th e TXmlC p T at U p As f o r p e C b n p h erD A: w t h C e g ou iv n t : en o I n t f f set , eg er) f o r t h ; e g iv en nu m b er o f ch a r a ct er s. p roc ed u re I nser t p roc ed u st ri D u n c t re n e g i E S f r o m el em ent e n b li b a( eD b m at S st r ing b t er ri O f f set int o w a ny O f f : I ex n t eg ist ing set st a r t ing o f n e sect io m ) t h h m t o b e b g a t , t h ch a r a ct er s, D at n o f a( t ex w t O f f f r o w er; sD v a l u C ou e no n m a nd t h set m a se ch a r a ct er o l ds t h ent o t h t ex TXmlTex u lac e su u do cu at e a t t : a: st ri n g ) ; t h e specif ied o f f set . I n t eg er; sD at t h ina t ed o f f set en r epl a ce it , w C ou n t : I w n t e specif ied o f f set , a nd ex it h t h e su a: eg er) f o r t h t ending : e g f o r ppl ied t ex st iv ri n en nu er ; no e a ct u is f ir st co a l o u da t a so m s sect io st a t e no nt ent l o a ded, nt ig u de. Th is co o f de, t h e o t h ns o f er t ex is r est o r ed t h e X t b e TXmlTex M no L do m cl a ss ( a s sh o t ent w it h in t h de t y pe sepa r a t es a l l in t h y cu g m t . ; b t h e do e N cu m ent ormali t : T h e T X m l T = class(TXmlC e x t d h arac (w O f e(b D eep e c t l a r a tio er at a) m e et h o : n eg er) oolean = c co n st r u ct o r C f u n ct i o n S p li f u n ct i o n C lon d ; reat e; t t Tex eN od f set : I B t : TXmlTex Tru e) : t ; TXmlN od e; o t n in O no M v e r r i d e ; d o f . des a r e pl a ced int o z n. erD w e D t ex j ect . Listing A-9 p w t ; t h f r o ea ch l e a( lass A- 9 en a sing at ch a r a ct er s. er it ing h D ppl ied t ex en nu t r a ct ist ing W sert ep ) iv TXmlText C L R g on x o f I nh n e su el et e t h t h f I t h a t h e 2 2 Appendices Th e pr o per t ies a nd m c on st ru G c t m no t u n c t i t h S t u l l o a l A- 1 w M D c b t li at l ing co 0 aS : T ec h t i e C st r u ct o r ct i o n C lon d ; st ru c t o C C m A- 1 1 eC reat eC D u r : aS D ommen p c u e n b li 1 : t T h e ct o r o n C lon d ; on st ru Bu o b o c ds o t il d f or co j ect . D D m e C i c o X tio n d t w : N od et h o m e d o et h o d n a n el em o n t h e ent . D o TXmlTex t f r o m t h t h a t de b no eco t ; e cu r r ent de. Th m es t h no e cu e im b e de pa st r r ent m t ex t edia t el y ec w o u t h r o u t i l d g h no r m C on o b a no r m D a l l y ATA sect io j ect s ( a s sh o a l t ex t w t r ea t ed a s ns. W in it h n in L ist ing no de a nd sim pl y e c l a r a tio n. ) ; e oolean D = et h Tru o ATA m et h t nt a in O M i e) : TXmlN ds a r e sh o sect io o d m on a ddit io t h ey n o n et h o na l , w no t h d o m l C o m m e o v r r D eep : e nt d e TXmlC reat ent s i no a ppea r a sed no de t y pe, e(b od no t t il it ies o f B ec e; m no t h a t t ex aS d on aS eN C at j ect ’ s m reat t h : e t ex r ef er ence t o h t e a b ; u i t m t er) t h de. C r ct eTex Tex eg no t st t a l l ina l arac n n new h n ld e class(TXmlC u reat i Th = f et h t e D t - b T o b at co t ex co Th e m c a l l y er el o od e; n b o el o v w e r r i ; d e : e f des do dir ect l y . cu a n el em m ent ent o b U j ect se t h e o r t h e inst ea d. lass it h in t h ) . Ano t h S i ct ec C ed b e; nst r u ld e on reat I st r a ig t h ta r i su ent . W a eep at h D v co a r e descr ib it s da t a ’ s o r ig in. D C C h ch a r a ct er s st o i : r n a a s TXmlC l C t j ect lass e(b ec e eC nt a ining e o r ig e; or reat TXmlC t h eN aS set class(TXmlTex od t h del et ed. reat no t Listing A-1 f a nd r et u t o f m = at ent s m f er it s a l l omment C m O ed a s j u X on n D T g h reat de co o f is cl a ss inh n o w nt a ining g o b t des dir ect l y . no ese a ppea r u do cu t h ( t t ex e f l a g f D C e C t t ex sib co on t h r o u o r no Tex nt ent Th e TXmlC TXmlC t e TXmlTex des ection C t h ) . Th p n t ex es a s a n indica t o r TXmlC u no t h a t ing Listing A-1 c li h a s co O 0 ser v j ect , new p ca n b e D e p ataS a r k u t o b ct t h e; t ex nst r u de f o Tex reat o ds o f e specif ied o f f set , no m co r ea t e a t h D ent on C TXmlC C ener a t e do cu f or et h e a l l c r a at a) erD l a d e B oolean ommen o b t n- essent ia l a s TXmlC o f it s a b tio = inf o r m o b t a t io n a b j ect s ( see L il it ies a r e inh o u t a ist ing er it ed. n. Tru j ect ommen e) : TXmlN a r e discu od ssed b e; o el o v e w r r i d e ; : e; w it h cr ea t e t h t h em e C reat dir ect l y eC w ommen it h t h t m et h is co nst r u o d ct o o f r . t h e do cu m ent Appendix TXmlProcessing P r o cessing do cu m inst r u ent TXmlProc a ccess t h co Listing A-1 TXmlProc p u e b li 2 : T essi n E S o ns se g I n y desig ned a ppl ica t io st ru l P r o c o cu m ent ction C a r e b f t ’ s D t i j ect ca r r y M o inf o r m r ea ding cl a ss on b 2 del 3 lass t o ns O ( sh o w t h n in a t io n o se L do t h r o u cu ist ing m A- 1 2 t h e ent s. g h Th e ) y l et s o u h g e T X I n st reat m ru c t c i on o v e ssingI nstr u = c tio n d od class(TXmlN e c l a r a tio n. e) c n st r u ct o r C p r o p e r t y D at a: p r o p e r t y Targ f u n ct i o n C d ; b el o w c on st e; e r r r e ad r i n g et : st r i n g r eN od e(b D eep : i st lon A TXmlProc essi n g I n st e ; F N d e od eV alu F od eN N ad B ru oolean c t i e = o b on w i t e w r i t F r ame Tru e) N od F N e : eV od alu TXmlN eN od e; ame; e; o v e r j ect ’ s pr o per t ies a nd m r i ; d et h e o ds a r e l ist ed : ru U c t or se t h t o rop reat m y D at no n- w im m a: st j ect ’ s C o ri f des, n t h g y b Targ et r iev e : st set FN n e f o g od nt ent l l o eV ing “ ? n g I nst r u alu e w n st ru c t i t h e t a r g ri et m on et h o d ct o r . t e FN od eV t h r o u g h alu f r o t o t h m e; t h e f ir st e ch a r a ct er ” . > read t a r g et essi a ppea r s in t h is pr o per t y , w e cl o sing ri t h eProc t h a n t h is co read e t a g ’ s co ef o r e t h et o r reat r a t h er it e spa ce ch a r a ct er edia t el y ert R o b ese no a inder h e; ent inst a nt ia t e t h ert rop C e do cu Th e r em p n U nt ent s. co n p u essi eir C I nstru ct io f o r A: FN od eN ame a ppl ica t io n w f o r t h ri t e inst r u e FN od eN ct io ame; n w it h t h is pr o per t y . TXmlD ocu Th e mentTy TXmlD decl a r a t io pr o per t y t o t h o f oc p c e n men t e do cu m li 3 : T h e T X men t Ty p e o r C reat st u co n r u d e st r u ct p r o p e r t p r o p e r p r o p e f u n ct d ; el o p m ct = roy y En t i es: t y N ame: r t y N ot i o n C lon i w : g h l D o c u m e v e r r i d e ; o v e r r i d e ; y it h p e d od eM ap od eN ame s: TXmlN eN od e(b D eep et h o : amed B N od eM oolean ds o f c l a tio 3 ) l. W i enca psu l a t es a ppea r s a s t h e D m it h in it oc Ty t h e p e a r e r ef er ences ent . e) N on e n n. N i b r a F e a y e ad r A- 1 ent . I t cu n g m e do amed i ist ing in t h TXmlN r L do cu t h is m ntT o ; a ns def ined w st at o u e; est t a l t h od D ( see t y pe f o r class(TXmlN r o lass cl a ss e ent ent , m Th e pr o per t ies a nd m b Ty e do cu e ent it ies a nd no t a t io TXmlD b u t h t h Listing A-1 u oc n o f pe C t h r e ad w r i ap r e ad = Tru e) e TXmlD t oc F En t i e F N od N ot F : u t i es; eN at ame; i on TXmlN od men Ty t s; e; p e o v e o b r r i j ect d e ; a r e sh o w n 2 4 Appendices c on st ru N c t or o r m C a l l y , reat a is l o a ded. E t o p rop a do cu ert O b y t m ent it ies, it em p rop ert R y N ert i h ich t h y ot Access t h TXmlN N o t a t io TXmlN at i i on t h e N ot ot at Listing A-1 TXmlN ot p c u e n b li at i c st r u ct o o p e r t y Pu b p r o p e r t y S y st f u n ct i o n C lon d ; ru U c r t se t h rop ert y N p rop ert R em p rop y ert y y if a t FN ap FEn t ent it ies pa nded, o u do cu ca nno t m ent a t t a ch it is do i t i es; def ined es no t no r pa r a m w t w it h incl u et er in t h e de int er na l ent it ies. E a ch j ect . eN m ent amed y nl y . read t er na l od cu ame ri t y pe N od eM f r o el ap e do cu TXmlN u e i ent ame; pr o per t y . in t h ot TD o b on eN is FN ent ’ s D at od t h read m ot FN m el em m l N o w e do cu at i it h on Th is m ent . s; t h is r ea d- o nl y j ect s. ist ing ct io ns. A- 1 cu e 4 m c ) in t h ent l a r a Th f a t t r ib a r e is D t y pe no tio o ey O M o v e r r d e ; r i n g r e ad F Pu b I d w r i t e F Pu b emI d : st r i n g r e ad F S st emI d w r i t e F S st eep : B oolean = Tru e) i od e(b on o b D li c : j ect ’ s pr o per t ies a nd m reat t a r g et b y t h ed f r o e m n. st eN a nd o f de. : y t es, a nd a r e r et r iev d i u r epr esent ed I c e; npa r sed ent it ies, inst r u reat X do cu TXmlN et h y od li I d ; emI c d ; o e r e; v o ds a r e l ist ed b r i d ; e el o w : m e; ent o b j ect ’ s C ri read reat eN ot at od eN i m on et h o d t o b u il d new des. eN ame: e o f t h b li c st e no t a t io I e pu st no ex o b y cr ea t ed a s a des, is r ea d- o e sing l e t o p- l ev o f e) if d b : st n g n is f o u ri n g l ic ident if ier no emI Th is pr o per t y st r ing e f o r m od st r ing S ese no pr o per t y . Th a r e a l l class(TXmlN e t h pt y e l ist a t ica l l y t h eM ex ns def ined in t h n d C od Pu et r iev t h tio n no Th e na m e o f ta at e t do TXmlN per t y T li or no t a t io e e do C n r st t h t h = p i o f e co on p h ot s: t m f per t y od nl y read o f cl a ss ( see L T N e t h a t ica l l y pr o cessing s pr o : amed t o lass e t h on on Th e TXmlN e na m s in t h f o r 4 m g t h e no t a t io ns descr ib ns n e on otation C a ppl ica t io ri na m i pr o per t y . I t em t o ne o e pr o p o f TXmlEn st at Ty is r ea d- o a r e a u e oc l ist t h is a nds t o N a h de is a u did cr ea t e o TXmlN t o g e l ist e t y pe no o u es: ame: et r iev rop t t h r o u w co r r espo p i in t h ent y since it s D a ccess ent m en if ent En do cu v m t a in e; do cu d pr o ne is su FN nd in t h read f o r is inh FPu t h b ame w ri t e FN od eN b li ame; er it ed pr o per t y . li is no t a t io c I d w n f r o ri m t t h e FPu c is pr o per t y , I d ; o r a n ne is specif ied. : st ri v ides t h ppl ied. n g read e sy st em FS y st ident if ier emI f o r d w t h ri t e e no t a t io FS n, y st o r emI a n em d ; pt y Appendix TXmlEntity C in t h t h o f i O t m t h e do cu m since t h M U E cl a ss ( see L y f r o t h is l ist e D t r ea d pr o per t y C S o f t ’ s D o cu m ent O b j ect su ppl ies t h M o 2 del 5 lass Th e TXmlEn ent it ies A: . O nl y e do cu ent m A- 1 ent ’ s t y pe no ese a r e a u t h ist ing t o m e def init io D 5 ) TD de. N . o a t ica l l y n o f t h Access pa r a m ex e def init io t h et er em o r v is m o t h int er na l pa nded a nd t h e ent it y ia ns o f eir del ed, e ex En t t er na l i t i es ent it ies a ppea r v a l u no t e incl u t h ded in e decl a r a t io n it sel f . Listing A-1 TXmlEn p u e b n li 5 : i t y = e ; i n g r C N ot at i on N ame: e ad p r o p e r t y Pu b li c I d : st r i n g r e ad F Pu b p r o p e r t y S y st emI d : st r i n g r e ad F S f u n ct i o n C lon eep : B oolean d ; st ru c t t i R u N I N r t u n g w a i t s eN t no N a t e t h e y O C v D F y N od eN ame I d w st emI d w = Tru e) li c r i r i : w r F Pu e b t e F S st N t e TXmlN et h F i t y od li od eN c d I emI e; o d v ame; ; ; e r r i o ds a r e discu ssed b h ent d ; e el o w : e; des a r e a u t o m a t ica l l y e a dded t o eN r j ect ’ s pr o per t ies a nd m reat b r ame: st a ri er it ed pr o per t y cr ea t ed w do cu n g m ent read pr o v FN ides t h en a t y pe no od e na m do de t h eN cu ame e o f t h m is f ir st l o a ded. er ea f t er . w ri t e FN od eN ame; e ent it y . l y , t h E r e n t y t y v U E S e at t h i o r o e v on D e r t y , n e N f t p e ecl e D ot eN C t r i e i N od e eName p Nod O t i t y n M r e r a ’ s t h n t u e a r m r n s t h e a u n t h e n t h l e s s n e a n y m a o e m u o e g o o f f t h t h t o e e e t h e e n n u t i t y t i t y n d e ’ s n i t s e l f . r l y i n o t a T g t i o h p e a n r e r s e r t . ame: st ri n g read FN od eN ame w ri t e ame; npa r sed ent it ies r et u o r r n t h e pa r sed ent it ies, na m it e r et u o f t h eir no t a t io r ns a n em pt y n t y pe t h r o u g h t h is st r ing . E l t h e o e(b o b y od t o n ert T od ca nno t y e; G h o d reat or nt it y ert f o O o u g s m e o rop t h t u f e Not r n t h ert t h e b ert e y e at c n Pu et r iev pu rop h r e R p d r o y U p i n. ct pr o per t y . F a r st tio t FN n e r a u n o l a r rop d c r n A e e) e r o N d od p A p ntity st n a l E o Th is inh i s m r rop t h X p E U T c Th ey W e n on p h class(TXmlN co Th e TXmlEn c T t o t i t y b c t d t h S y st emI r ns a n em a l u : b r o . p H e o r t y w e i s v e ri n g d : st st r ing read l ic ident if ier is specif ied, r ea ds o r pt y e st e pu l ic ident if ier y v m r , a t h p p e e n d o o d n e t o n a t h m e n e o f i e d e l d n s h a o u m e l d f i e h o l d l d , i t t h e l f . I set Th is pr o per t y r et u c Name p on i t s e li e o r i r r e ri w n g a n em read r it es t h if no FPu f o r pt y FS e sy st em sy st em t h b li st r ing y c I d e ent it y st r esu emI d ident if ier ident if ier w ri f r o t m e t h FPu b li c I d ; is pr o per t y . I f no l t s. w ri f o r t t h is a v a il a b e FS y st emI d e ent it y . Ag a in, l e. ; it 2 6 Appendices TXmlEntity R R ef erence C ef er ences TXmlEn t i t o t y pa r sed R ef eren t h is r ef er ence du Listing A-1 TXmlEn p u e b li u ct o r i o n C lon d ; T C u p U E m e n e a S n r t e o n f t t . w o p S st n ed b ru el o c t ert w t h ist ing A- 1 d e c l a r a no tio e D 6 de ( if O M w ) . Th e ch a v a il a b l e) . it h t h e il dr en o f n. r : e i ; d e B oolean = Tru e) : TXmlN od e; o v e r r i ; d e r s e N m D e co nst r u TXmlD oc f u na l it y . I t oc p c li b c men : t T y R h r u ct o r ct i o n C lon d ; ru m c t f X nev er no e n a i r t i t y d c o r n o f o c r r e a t h m l s u e r e u m f e r e n t , e s p o n b s e d t s n c e n i n a n y i w e e t s o g m TXmlEn i t h n o y t h r e ’ s t R i n t i t y t i t y n t m c t h u class(TXmlN r r : t h m e ent il d no i b ef s u e a b v e b f e n t r e a e i l a eren c o r e d c . b y o l s o t h d , e e s t h e . o b e f n A l e o e j ect a r e FN ntF r a t h gm e; ent f r a g m m e B oolean ent ent o b m ent ame f t h a in D t h w I nst ea d, o ri b u t h se e j ect . t e FN od eN ame; e r ef er enced ent it y . L M m em st r u ent b it h a ck int o nt d e c A- 1 o u l a t r a ct u r e. I t s pu it sel f , ist ing de w e O e do cu t h 7 w e h ) a dding tio a l l o ing em t o ier a r ch y . Th pr o a ny r po se is t h v new ides a b t h e is il it ies. n. e) = t h Tru u men t Frag no des w j ect . e) e m des a r e pl a ced int o reat eN e o cu ; d oc od e m f od dir ect l y . e do lass is a dded t o TXmlD e do cu e t h e na m a sic no = eep m v m e b f ( see o D C read t side o j ect s d o ides t h cl a ss o a g o b o ef o r e a dding t e(b f n ese et h a ppea r s in t h e; f r a g t h e m c l D t od il d des o u eN ds o or o d o f s ment C reat it s ch o d t e pr o v t r a ct ed b men ent il d do cu et h ex T C st n o u ri rag ent e n et h x ds st es f r o rag a l l e e eren der iv F Th e m n i n t h b ef men t I nst ea d, o a e; Frag men do cu p d i n et h ame: m u en a x a l y d no t t ct ed o r 7 n r e m e l o o l a t r ees o f u m i eN f Bu e s u , do t co st d y o M reat f r a g b TXmlD O s a y er it ed pr o per t y e su u l w n a nd od ent a na g nct io a e e C eEn y r h : m on r ef o r e, Listing A-1 c e) eep w t o h od v mentF A do cu W class(TXmlN D or b ocu n f e int o n in L ed ent it y e o od t i t i e Th is inh e e na m nc e(b t h e reat rop b e pl a ced w r e = R e; pr o per t ies C u e ntity eN , i n f As TXmlD c l E reat a o i t h t s descr ib on m t h o E e Th e p C r ct c X eren st o c ef T a r e ss ( a s sh c n p c R e n o a y ent it ies e cl a c pl ica t e t h o se o f h u h d t T f O T i : co n N t 6 lass it h : TXmlN a in D t h e h men t t h e C O M od , ier a r ch o b j ect reat e; it y o v e r is no t r i d e ; inser t ed it sel f . in it s pl a ce. a r e sh o eD oc u w n b men t el o w Frag : men t Appendix TXmlD ocu ment C Th e pr im t h e f u nct io a r y TXmlD f m m t h et h o ent oc p c u b li n men t o T h C u u ct p r o p e r t y A c p r o p e r t y D oc Ty p r o p e r t y D oc u p r o p e r t y D omI r e ad p r o p e r t r w r i t e o t h X t u alC D p t ct i o n C lon n ct i o n C reat eA t f u n ct i o n C reat f u n ct i o n C reat f u n ct i o n C f u n ct i o n f u n ct i o n f u n ct i o n a: st f u n ct i o n C reat f u n ct i o n G et p r o ce d u r d ; O T e ea v oreC reat eElemen t (sTag C reat eEn R ef C reat eProc u h od Elemen t sB b j M o b t L o A del c t alC u D e it r at n a: st r i on (sD at a: F rag men t N e lemen g I n : TA j ect , ) . a s r epr esent ed b Ano t h t h p et D w Ty e D er O m im M . U pa t ib ct u alC g = st r st e(sN ame: ru i c t r i on t g ame(sN g n Tag n r ri b t F e A c t u alC r i u men t Elemen ed O u t u t w r i t e F I d A r i t e I g n oreC oc at i at t h e it h t h e D A TA ; t u t e; ; on u i e) ame: ' ' n g : w TXmlN ) u ) : st r g n od F t e; ri b o u v t e t r t r ri i d ommen t ; ' TXmlC D at aS i t y R ef t ; od eL i st ; ) t F : rag men t TXmlElemen ) n : g et ru c ' ' ) : i n g ) st t i r on i t t i on ; ; t eren c e; ; n g ; TXmlTex : ec ; TXmlEn : ; e e; TXmlC ' b ase; = men st r t p : i = st e TXmlA oc I t t ase (sTarg st a: t i n essi at j ect ’ s pr o per t ies a nd m e o b D at a s aS t h e ou rc ss ( descr ib j ect TXmlN et h o ds a r e discu ssed b el o w : m o a ccess sh l t o f o r L l o a ding oad M cl a ss t h a t l d b e t h r o u pt y ca n b g h t h e D FA c a n e u X do u cu men L et h m sed t o oc M m emory ed l a t er ) . An em del o u r esu e do cu o ent g m ds o f no de ex t h ener a t e a pr o per t y t ent e ist s new o f t h e cl a ss. alC A D TA A TA : B oolean read t u alC D A TA w ri ns w it h in t h e no r m a l t t o inst ea d o a p e ; Tru e t o o u f r r o u nding a s False ( t h D sing l e w su e def a u t pu l t ) t o a r t t u C D t h em ATA sect io se t h w it h e C D t h ATA sy nt a x C e D D r o p e r t y i s n o t p o f t h e W 3 C D O M s p e c . i f i c a t i o O M a s ATA t a g s. E A y po r t a nt e; ormat : g c st F ) n TXmlD e(sD N i F Tru i ame: eren cr ea t ed is pr o per t y t y oad ent . Al l m : el cl a od in t h b 8 e; a r e e 7 ll; reat t h st TXmlProc ) C = ame: n N ent s oolean essi ' men B t t t eA : e(sN men ' or pl a in t ex L t n C t t h A g oc init ia l l y et d I eD = G I r A ad F reat oc 2 del des a r e co D oc F (sD emov o a dd t o D ad ec eTex F ad t g o A- 1 alC e D y u e ommen t t r eC i ad r eC t c e g i t u A r e n r u aS F p Ty oolean st eep n ent M n. ad b at tio ad e t r a e B ri l a r D i j ect ; t m od r men e(b r eN c oolean e: ase: e B t n b e no mp b u t h t ; u m des t o omI t f no r es t h a t TXmlD u u cu : p f O ist ing TXmlElemen t ri L on u t e do in : O oreC ent i ed t m t at t n S t u ormat A u oc F g y oolean : d t B t I c : on I ert ; TA u y FA ; e i y rop e d p t m d i t t j ect i r at r o b r r u r do cu r e t e e) e O e od v ed p t h n nt d v lemen p e o Elemen o g m t R w o lemen o c u TXmlD r o cu is v ia ; A men mp c (TXmlN e: mp o e; r o cu l D roy p ru M ( sh o ormat e f t ’ s D er . m p st O F TXmlO h est omI F t h r o u N D r y at e D ided h reat r D T v class r D t h cl a ss t T st on p e n F o cr ea t e new e o S er e ensu = ct E is cl a ss is t o d Th e TXmlD c : U ds pr o co sD e 8 u st men a nd ea ch Listing A-1 TXmlD u C lass a ccess t o oc n o f a ct o r y do cu A: n . 2 8 Appendices p rop ert I f y D a D r et u oc r ns t h p ex ist s f o r e specif ied, T Ty TD e: TXmlD a co r r espo a nd f o r H oc u men t l o a ded X nding TM L Ty M TXmlD do cu m p e L do oc u ent s, read cu m men it FD ent , t Ty r et u oc Ty p e; t h is r ea d- o p no e r ns n de. nl y I f pr o per t y no D TD is l. i I P Y o u m e p c m a o n n r y rop o ert G e D D nl y u N O S T i n i s men t y D b u omI mp e i n mp a m t p p a d ert w ri W h T D F r t t f t O t t y t t i at on im p r e : e a d d e - o n c l a l y r a t i o n f o r a n e w d o c u m e n t i n . TXmlElemen t read ; t o p- l ev at M at i el el em ent r ea ch is m i on it v o r e co : Tx in t h ia t h nv mlD e do e C h i cu m ld N ent w it h t h es pr o od is r ea d- per t y o f t h e enient . omI mp lemen t at i on read ; pl em Format e t e, t ed FFormat t h nding i s on lemen a t t ed f o r mat t h e t W ert ed 3 y d ent a t io O t a r e at i u t ed s e p O r ea da b u u t t e n f o r d i n : p w t h t t h is do cu m ent t h r o u g h t h is r ea d- i n U E D S e o l p f t oolean ses t h is inv ent s a nd t ex w r d C p h a i , c t h k a read i s g W e 3 C D O M a t t r i b u t e . FFormat t ed O u t p u t ; ca u l e st r ing o e B u il it y . Th e el em sing r v on is pr o per t y t h I A t d t it h rop g A p t b t L g n w c h t C ov i it h e X o l v b L g ener a t ed b es a dding t . W no M h y t h e D O M t o b e l ine f eeds a nd indent a t io en False ( t h e def a u l t ) , t h e o u n t pu t r ea k s. b C l t o py t h cr ea t e a t i f i c e: t r a i b t i o st a t t r ib Q oreC lon d t A c u n e, t a n d I g n or eC as e t ri b p r o p e r t i e s a r e n o t er y ing N ame . ri n g read FI d A t u t e w ri t e L u ( X t e t o M ase: L B b Q e u u sed a s t h er y L oolean a ng u e el em a g read e) FI ex g ent s’ I D pr essio n oreC e G et s w h en q u ns. ase w ri t e ase; elec on u d e e; t co N nt r o eN l s m es m od er ea s set t ing erri I s p a nd X oreC , t ri u Th is pr o per t y a nd S u M def a u S I t O t ri y n u D a X ert FI O C pecif y w n t i s ca n a l so lemen mp en Tru or o S u n t h is pr o per t y e D omI y t r r o u FI f e r t y E e rop p m e Elemen o u mp a ppea r s a s a O u p Elemen lemen lemen e su h t c r o pr o per t y . f o r m N o p e sing l e, ent , omI nl y rop T d l d E c r e p a f i e u Access t h o t e men e t h m ert FD a i s pr o per t y . Y do cu rop r e t h oc oc et r iev o p c c y et R t s i n it t o od e( et h a t ch ing o ds. I f False ( t h b D eep : t h r o u set t o h t h e, Tru e def a u B g l t ) oolean m Elemen a t ch Tru e) sB y Tag es a r e ca se- insensit iv enf o r ces m = t a t ch : ing TXmlN o e, n ca se. od e; e; e do cu new do m ent cu m no ent . de a nd, if b D eep is Tru e, a l l o f it s ch il dr en t o Appendix f u n c t i on Bu C reat il d a eA new na m e o f a n el em A: t t e new ent U ri TXmlA t h C b t u t b S t b u eco u n c t i on G m f u n C reat ener a t e a et h c t i on C D Th is m O a l so f u n c t i D u n C e pa r t m ent f r a g t i on C a s t h e ch D oc u n c t i men t on C t h f u n c t new i e r eq u on C at n c t i on C f o r m reat f u n c t i on G e g iv a ppea r p no roc C ed m u o re m t o t h in t h R ing emov pl et el y em t b ri y b needs t o . U u t e; pa ssing se b t h in t h e e a dded t o e el em ent ’ s o = ' t h ' ) e su : TXmlC ppl ied t ex ne a s o ne o f a: st ri n g ommen t t h r o u it s ch = ' ' ) t g ; h t h is il dr en. : at t h ec men t D f t t i : O no h i ld t h c e( u st r u n t h g ) ch et h et h ame: st t et h o ier a r ch y , b u t d, pa ssing a no t h er no eco m es t h d. t a r e ent n g in t h de. I f is ) ; e v a l u a u a n el em ri ; m o d o f ca n r e. el em o men t h is TXmlElemen b il d m h t o o u ent . Frag it h M : is m a l so t w ct u a dding a n el em men de O de f o r is ca l l ed. Y d o f a in D y it t sN o ch il d o f new Elemen en it no ri no on h oc t t h a t a s a i et h e m de it sel f , eren m men st M A t TXmlD Frag ame: e D ec de w on t side o f N aS e no a dded t o ent ef t ' y R b ef eren e no c e inser t ed, n ) g I : de u sing a nd a dd t h M n st ru c t XmlProc essi t h e D od O o t o ent e pl a ced e o f m t h e a t ica l l y no de. : t h is m e new no et h o de t o d. S pecif y t h O e D M n. N e t a r g O M e( n g et st r u sD at new y q u i I n st Tag N sTarg ru g c st ri y o u a dd t ex sN n n st c no t i de v n a nd it s co il d o f = de, t o : ru on e ch ca n u t et st i g no t I t a ppl ica t io a: ame( ( n ct u r e a s t h TXmlTex ick l y on essi . Al t er na t el y , t o sB ent s t h a t e. U se a e o r der no M t d, 9 ' w ' ) t h se t h e C a n el em ame: st n g ; ; ia t h is m m m a n ex : it h ri on et h o d, a nd. Ag a in, ist ing no TXmlTex t de. ; e specif ied co nt ent , reat Tex eC h i ld t ri ent . n g ) : ; e el em en na m o 2 del TXmlA et h O g t h i t h t n ist ing at aS men sTag t o ent Elemen : o e; ces a e D st at des o u essi t D it h t o e o f du ri de is cr ea t ed b R t de t o t h i u ( c ' eTex M de st il l e de w TXmlC D TXmlProc a n el em eL a t ch y = d pr o et od ind a l l t h o o d o f TXmlN F et h ) is m no no eC t e na m no a dding et h i g new in t h Th is m n sD nt ent Frag m eren eProc ri e new t e ent it y reat ( pr o per t y . t t ef t h st t C oc t TXmlEn ener a t e a a dd t h R on co e no ir ed po sit io a: pa ssing u men reat eEn y e o f sD f t il d a t h G i t ld e do cu e C reat t e na m a t t h t h i j ect g t h l t ing t h b n sing st a n ex new i a na g Elemen it h TXmlEn Bu h e. Add it il d o f a dded w u eC eElemen ent ’ s na m de t o e t ex TXmlElemen el em t no ent s a r e no t m reat a: en TXmlD sed inst ea d t o c at m t ri O d. sD ec st o f ( ces a u o ent ; t h oc m et h m de u om no aS du eD new C on reat a A new f e C t l at i pecif y reat t a in D t d pr o . S se t h o cu u f u b eC ec M on O reat et h o e D m e new at aS X ame: e no t o cu t e. Th e r esu m ommen T o d. Add t h TXmlC t h eC new f t ’ s D sN u SetAttributeNode m f o e( ri a t t r ib t o E o f a a r e descenda nt s o na m pt y f “ * pr e- o r der des a r e f o u eA e o nd, ” t o t r a v er sa l a n em f t h e do cu r et r iev pt y l ist a l l it s ch t h r o u is r et u m ent g e a l l h t h no e do a nd t h a t cu m ent e do cu m ent o f il dr en w it h t h is m et h o e des t r ee. I f r ned. ll; t h h a v des. Th e no d. 3 0 Appendices N O T T h N R O M E e T emov h m o e n G d e et f r o E m f u o m TXmlD g s e t h a m ll e t h o d i s n o t p a r t o f t h e W 3 o s p a t h n c f c t h e t a B 3 a C T O c X mlNod r e y D l i t y T w s W n e - a lemen e t i o v e a M L n b n o e e o 2 p s p t e s s ) , t h e t h C d l i c e a f t h l u c l a s Name m ag v d e r s i o e e e c i f i c d Th e TXmlD t side D O M I omI o f mp TXmlD omI p u e n b li c f u ct d ; n Th e m u n i t 9 mp i : T H o H it h v do e T t f i X m b S r eat u re(sF h et h et h e if desig ent a t io e D O TXmlO t a sk . b C j M el co g et E eat eE e c i f i c a t i o n . h v a y m T eEv 1 t h is a t m L O r e h t h t h lemen t lemen i F B y , t e e I C mp or m d r or t ceO e eat n t h eA t e m Nod w er o t d r D , i e a b t h ocu n u o d t t h e, t d men a e n d ist ing A- 1 it s 9 a b ) pr o v ides f u il it ies t h r o u nct io g h ns t h e ent . n d on t e c l a st i sV im r a r i tio n. ersi r eco n “ 1 . g j ect on : m ; a r e l ist ed b ri n su n g ) el o : B : oolean ir ed v l e a nd False o t h o w ; ppo r t s cer t a in f ea t u e a nd r eq u a t ch o f oolean st r e na m niz es t h ” 0 B o b is a v a il a b t o : g ent a t io f ea t u l a nk ) n on pl em l a r na l it y b : at re, M l O = b t r eEn t i t y en t = f u sPu b li c I , sS y st = class(TC p n r j M od o t e ct e d f u n ct i o n G et ErrorC f u n ct i o n G et O n Preserv p r o ce d u r et O n ou el o 1 o ce v ar n ct d n a ny e f ea t u su er w ” L n, it ise. Th ppo r t ed v r es “ XM r es er sio e er sio a nd “ H n. TM ” L ea ch . e c l a (oO w r a n ex m C U ) el su ent , E S ppo r t ed b it n is o f t per f o r m t ensio t o l ef t pa ck a g y st r i n g ) n t i ec st j : b d TO emI t I t t eg e: TO e: B : b j f o b j e e e, t h e s t h is necessa r y t h e W 3 C D ; ct ; e ct ; TPreserv eS p g o f o b j ) er; TPreserv e(Preserv eS eS p p ac ac eEv e: en t is t h ; o t h t o n. er: n ac 0 ) w p A- 2 t (oO eS e ec n n t h oolean o r tio er: i en e on Preserv d Preserv ac a n e l ev do cu I n is r p is t h a ist ing cl a ss b : ich na l it y . u eS h n in L l omp n w w cr ea t ing ) . e d n, o f nct io ( sh o ; g a y f u j M st i w ent ir e ev en S u er sio nent ame: e tio lemen r r ent l y is ac el nta specif ica t io t h po X d m ersi e l ef t no N Ev e cu pa r t icu b n cu ide l ea st e a g lass do sV nct io a nd v el ent l y , T n u a ccess a m mp is D f u p ame, b : t i o r o o u re, en a t esolv p 0 eS sElemen r s p omponent ev od n ( a t Listing A-2 t h def ines pr o o nseq u TPreserv L n, t o specif ica t io TXmlO M ent a t io l e sFeat m e) , el C u omI iv t h a t pl em ner s sN er Th is im p eat o d. G et er pl em TR M class re( n pa r a m od I m e TXmlD ine w is m m = er sio j M o f o a cl a ss ( see L on pr o per t y l D u i Y on r ns Tru ince t h im O s . ent . i t h at m at ( ca se- insensit iv TXmlO t cu on asFeat t h r et u h ds o et er m w lemen at asF n on D t lemen o et h c mp a ny lemen Listing A-1 f D t h omI mplementation C o u C E i s s i n ( w eA ; ac eEv en t ) ; O M Appendix p u p b li n r u d e st r u ct n S ct p r o p e r t p r o p e r t p r o p e r p r o p e p r o ce f u n f u n f u f u b p r D oc y ErrorC t y Errors: r t y d u r ct i o n G et ct i o n L oad D at n ct i o n L oad M emory n ct i o n S av li sh e d o p e r t F ormat w r i t e o p e r t w r i t e r u C t : ou n oc w n er: o v e r o f t ’ s D r o cu m ent O b j ect M o 3 del 1 e ad G et TS t ri n g L i st r e ad F Errors; men t : st r i n r e ad G et XmlD oc men x t eg er) : S t ri rc e: S ri n g ) : u men r u ErrorM ; d (w I : I ou rc e(sS ou em: PC h ar) le(sF i le: st r i u t : t p u t ; I O st r i n d A t t ri b u t e: et I d A t ri b u n oreC t t oolean r e ad et oolean r g ase: B ormali z eD at a: w r i t e N ormali z eD at a p r o p e r t O n w r i t e o p e r t w r i t e r o p e r t y Passw r o p e r t y R ai p r o p e r t y U serN d ; b j M or C y f o r or o u co po ert m D y rop rop u y ert ri D u co A t ri I g n oreC F N ormali b u t t ed O u w r t t p u t e S et e Ev en ord w g oolean i n st r TR y esolv r e r m a ent G et e ad G et ad e r ad TC nt o m z i I g n eD at t r e ad G et O n t r e ad F O R esolv t e S et Passw r i t e S et U oreC ase; a Preserv eS p ac t t y e t n eEn i ; g es f r o ase y n r G i B el co a b m omp w in co Passw F U h R ai en r i seErrors serN on f o r m po e( e co r u A m O ame , t it en r eq u w r i t w e F de. Al t er na t el y , y o ai ; seErrors; ame; n t h en set o u ord R serN ca n a ppea r ir ed. Th n er: nent t h e co m po nent it s pr o per t ies a nd ca n inst a nt ia t e a co py er w TC f r o omp m ise, t h u on en t ) e pa l et t e, se t h is co y et h o ds a r e l ist ed b ; ov erri o u do no t nst r u ct o r t o d w : e; h a v g el o e t o cr ea t e a n ener a t e a n o b j ect se. ; ov e o b O nent ’ s pr o per t ies a nd m w po roy b t h men t erri j ect j ect s nt o nl y m o : a u y o u m read o u e; t o f r o pr o per t y Y d del a r e e f o r m il it ies. FD r sel f , r em em b m a t ica l l y dest r o t h e co nent oc u m po men t er y t o t h e do cu sh l d t h e nl y u h en u p w y h o u en y o u dr o p t h e ; ides a ccess t o o w pa l et t e. pr o v o u f r ee it ed se m ent do cu m in m ent em o r y t h r o u g a nd h t h is . e nu m b ou er n t o f Errors: et r iev w d t ormat : I n t eg er er r o r s t h a t read o ccu G et r r ed du ErrorC r ing a ou n t ; pa r se t h r o u g h t h is r ea d- pr o per t y . ert R F t i ErrorC nl y et eEn st r sel f . O o oc it s ind t h o ; en ord reat nent y ert F ; ; eEv t ed. ech a nism rop ; oolean ac : est Th is r ea d- o a l l ; B G ad t g p i cr ea t e t h f inish rop n : men eS y o u D a r e m u TPreserv t t h y I f ; e; t od dr a g del t de. t t t e dr o pped o m c ac i ir ed do cu n ad eEn : ou e e: p eEn ame: o u ru ac eS seErrors: inst a nce y o p B esolv is cl a ss der iv A TXmlO est eS Preserv p e oolean I N n B et I esolv : G y O g ad y R ) n e t n d oc oolean r t et B g r O i e; r n B t e e O ; r ErrorC r e Preserv r ; oolean p et n M ed (c p c g t p i t t sg aS eToF p e u learD R v oc o y o u D u S o er o ru F p y ; eg O S ) t t F t n u y en ad ed S on I t y omp e r I f e : r st d ; i t p r TC r ormat in co p S F S ent ir el y p E O ; p on U et y e r eq u p roy men XmlD e l o a d t h p est e(A y ince t h d reat r o pa l et t e a nd b c C o D p e st r p C c co u A: e a y t l ist Format e S et pl ica t ing nt r o l s t h o f t TS t h ed O Format t h e e f o r m t ri n g L i st read e er r o r s f r o m sa m u t t ed p u O t u : t B a p u oolean t o f a ny it h t h read is r ea d- o G et nl y Format pr o per t y . t ed O u t p u t ; e pr o per t y a t t ing FErrors; pa r se w o X n t h M L e g do cu m ent ener a t ed f r o o b j ect , m t h e D t h is pr o per t y O M . W h en 3 2 Appendices e, Tru l eg p rop ib ert S indent a t io l e. W y et I I d p A t ert S t t t ri ri a t t r ib y et I I g g n b u b u u t t e Ano t h n t l ine ( t h b r ea k s e def a u e: st ri n l t ) , g a r e t h a dded e t ex read G t t o is j u et I d m st A o t a k e ne l o t ri t h e b ng u t t ex t m o r e st r ing . e w ri t e e; a pr o per t y o n t h is t r ea t ed a s t h oreC oreC er e do cu e I D m ent a t t r ib o b u j ect , t e t h f o r is o ne det er m sea r ch es w ines it h in t h e q u rop ca u er ies. W ert FN y N m g ert G eD h O O n z n eD at ev ent su ml: sp ac g p B G et e do cu no r ed l t ) , m in I m g n oreC ent o b a t ch es ca se is u oolean ase w ri t e j ect . W u h sing sed in det er m read FN en Tru X ormali S L ining z eD e, a nd a at m a X t h is Q L a t ch . w ri t e a t t r ib ac e: e o w TPreserv ri nce t h e b u l t s in ex t r a e pa r se pr o cess. O w t h h it e spa ce b er w ise, a l l eing t ex t st r ipped da t a is sent l t ) . p er s e r esu Tru ac ppl ies e t h ig e def a u in t h eS eS t r ig I t m e a: pr eser v a t io n set t ing , x b t o da t a Preserv pr o cess. read a is pr o per t y Preserv Th is t o a s is ( t h e def a u y et ca se at ch a r a ct er t h r o u oolean en False ( t h z t h B co pied f r o ses ormali et t ing f r o rop h ormali S ase: ase; pr o per t y pr o per t y p a nd ier a r ch y . rop p n en False r epl ica t ing h a t h d A Al so w h t e f o r et O ea ch na m e a sed o t es. S o p ed ev en eS p enco u el em ent ormali a t t a ch eEv ent t h a t e N ac Preserv el em f n t h An eS n z eD ent t read ac e; nt er ed at pr o per t y h a ndl er cu t h t h a e in a nd m e pa r se r r ent spa ce a nd a ny a y a l t er t h e pr eser v a t io n f l a g . p rop ert FO E p x n R t er na l ese y t h e pa r ser ert W rop y y R ai et t h m po ert C o rop y G t y st TR t a l o t h e esolv eEn et esolv O n R ed t h r o u ng it s pu o f t h ri n st S e r eso l v w e a ct u l t : : ri it h a l pa t h t o e h a ndl er f u g read G b t g i y Ev h t h en t i t t is ev read y ; ent . I t l ic a nd sy st em t h e r eso u nct io et t eEn pa sses a cr o ss ident if ier s. U r ce a nd send it b sing a ck t o n. Passw ord w ri t e ; a n X M L sed t o ns t h r o u pl em y ( t h serN serN m f il e f r o m a n F g a in a ccess t o t o g B TP t h a t oolean e t o Tru h t o t h e def a u sit e, t h is pr o per t y est a b l ish es sit e. read FR ai seErrors w ri t e ame: h a v e t h e a ppl ica t io e pa r ser n. O t h er w pa ss TXmlParserError ise, t h ey a r e t r a pped b y t h is l t ) . st ri n g read G et U serN ame w ri t e ame; ent ing do XmlD t h cu m oc ener a t e a n X nl y i w seErrors: nent U U ert o ord ord o r d u r et r iev ing p t y e ent it y , is pr o per t y co et t a s t h e r esu ai cept io S i seErrors; ex rop t h en r ea ding ert eEn t ca n a dj u Passw e pa ssw FR S e o f o u Passw h t h eEn r ef er ences ca n b e na m et esolv esolv t h S p O R t h rop p y n pr o per t y . M u e Passw ent s f r o men L t do : m st cu m pr o per t y , ord F TP ri ent n sit es. I f g f r o m read t h e D t h is o no t G O set , ne set s t h e u “ an et XmlD M in m on oc em u y men o s” mou r y w t ser I D is u sed. f o r ; it h t h is r ea d- Appendix p roc ed u D co f u n c t i n on o d. D u m z er o t o t on i F L su n c t i R m L L u n c t i H on S su Th e C ch U it E t o M e a t t h e su e do cu t h w st r u o u r o a k Listing A-2 ri b t h en e T t ou t h is m v a l u t h c p o f S t M o 3 del do cu t em: s m PC et h ri e ri o n m n g 3 ent ca n t h en b e ; pa r se k g o h t h pr o cess : B o t h w it h e index oolean e pa r ser l t s t h r a ng is es u se t h e specif ied a s H e TTP do cu m o r ent s a r e enco u is nt er ed. ; pa r ses r et u n t h e r ea so n( s) . oolean it ; o r t h l em t h o es, if pr o b f o r ne n. Ag a in, B f il ena m r esu e is : es t h r ned if ar) d, ) a s l o ca l Tru sFi r D le: O M st ri in m n em t y pe decl a r a t io a inder a n F is w TP pr o b w ) : r y , a do cu r ns Tru B oolean n is no t el l - f o r m sit e t o a g o ed X is m m e if ent su h el d ccessf u l in a nd M L . Y l em ; et h incl u o d t o w ded in t h o u r it e t o . Th e f u r it e it e do cu ca n specif y nct io n r et u m eit h r ns Tru t o a ent , er a e if it a r o se. er: e 1 : t y N ame, sPu on D ec en sN ot at o u i n g ) o f o b j d u r e (oO w n er: li c I d , sS y st emI d , sN = p r o ce d u r e (oO w n er: li c I d , sS y st emI d , sN = p r o ce d r e (oO w n er: li c I d , p r o ce v ar b en t st r en b = i g ; p r o n n t = ent r L y o u el l cu w o n t h m g h it r sel f h a ndl er s dw do o u it h es a nd u se it . e co ent s do m po Th e nent pr o j ect . Th is cl a ss a ppea r s in u c I d , sS y st r o ce u e f ) f o g = d t r d i r n y u r e b Preserv r e u st w e ; ec f t o b j e ; ct ; st ec t ; at i on N ame: j ec t ; b r i B g b o j (oO w n er: TO emI d : st i n g ) st n er: TO b j : t ; b j ec b r j i sV o t st r i n g ) o f o b j e ct ; st r i n g ) o f o b j e ct ; j e ct ; j e ct o b j e ; b ; ) o t f ; ct ; ec n f ec oolean TO n ec ) n TO e: er: ame: j TO er: n N b ot : ; on TO n t i b w o ec at o r ) j b o (oO ct ; j i ct t b ot d w (oO j TO emI (oO ec ; ct sS d ce en st u j TO r sPu p y b ce t ame, li ev e pa r ser ca n a l so oolean o st t i u r p b i b ) M a l t h n. n t sPu tio w at Ev r a (oO ot e: l a e en y c r i t e u t i d d En alu r ce L rEv r se o = eEv a r XM ame: l P p sPu = m B ame, st 1 inco r po r a t e int o TO N N pr o cess X n- v a l ida t ing , ist er ing A- 2 : = n r eg ed d t y ist ing t o is no ca n a ccess t h er: t ac b ( see L o u i sI p il t - in pa r ser n en lEv u f y N pr o cessing t o b f t ’ s pa r ser ent s. Y nent t Ev m o n , y n a S w t t E i i 0 U ec t t e (oO sEn en S t h e Errors pr o per t y M io u : m d inv p d eEv j ect e Error pr o per t y , er S lEv t o e sI sV et h b ec ame, b d. A new er) e: r D eEn rc ; y alu sS d l, sN e( g t ame, o f r o t h n i esolv f ce ec sN 1 i sD essI O . – o en sElemen eg es r lEv on t r ec eS n p p i I st Ty eD et h essa g t po = oc on n e r el ies o X e: TProc TV T eEv TPreserv TR : alu t ( ent ea sy sV sEn TN u ent nit . ame, TEn e a b r n ed do cu sN TD TN ing 1 : il it ies o ct u r e. C w it m x t h le( m el l - f o r m e XmlParser u t d m eck o u pa ck a g M y m omponent o f t do is m ppl ied l o ca t io e o r pa l et t e, t I rc pr ev e r em m TA w ou ch eToFi TXmlParser co t h ( ou emory t h h O f o r t h er r o r r et u ca se, av g S o cu l o a ded a nd False is r et u f il ena m e D eck it h cceeded a nd False if t h f t ’ s D ; e pr o cess, t o TXmlParser C int o aS cr ea t ed y f il e. Th o u o no t . a v ing l o ca l t w sg a l A l l y o r y a l t h at s. False if f idu t h oad il a r em S il es a r e ident if ied eit h e l a t t er on im D o f ccessf u S E M ErrorC ent . F U I n t h U men O pl ica t ing oad ea r t m TP u ErrorM indiv et h do cu u et e f r o c oc e ent ir e D G Th e h f learD C ct ed. et r iev m u C nst r u R f re el et e t h A: t g alu ; o f e: o st b j r e i ; ct n g ) o f o b 3 4 Appendices TXmlParser p r p t e ct e d p r o p e r t r e ad u o p b li esp n I g n h i t I g n orab leW h i t esp ct o r C reat e(oO w n er: v e r r t n ) ac e: ac e n r u st r u ct p r o p e r t y ErrorC p r o p e r t y Errors: f u n ct i o n G f u n ct i o n ParseD at f u n ct i o n ParseM emory b li sh e d p r o p e r t w r i t e st o p e r t w r i t e o p e r t w r i t e r r D o est r et TC t ) ; I n t eg er r e ad G et ri n g L i st r e ad F Errors; sg (w I d x : I t eg ErrorM aS ou rc (c p M ormali z eD at a: N ormali z eD at a; O n A t t ri b u t e: TA O n A t t ri b u t e; O n C D A TA S ec t i on : O n C D A TA S ec t i on ; arD TV alu F y F y F leW oolean t t ri b h i t esp ac e; y O n C h t y O n C ommen t p r o p e r t y O n D oc Ty p eD ec l: w r i t e O n D oc Ty p eD ec l; o p e r t O n En d D oc u men t : w r i t e O n En d D oc u men t ; o p e r t O n En d Elemen t : w r i t e O n En d Elemen t ; o p e r t O n En t i t y D ec l: w r i t e O n En t i t y D ec l; o p e r t O n N on XM L En t i t y : w r i t e O n N on XM L En t i t y ; o p e r t O n N ot at i on D ec l: w r i t e O n N ot at i on D ec l; o p e r t O n Preserv eS p ac e: w r i t e O n Preserv eS p ac e; o p e r t O n Proc n g I n st r e ad n Proc g I n st ru c o p e r t O n R esolv eEn t i t y : TR w r i t e O n R esolv eEn t i t y ; o p e r t O n S t art D oc u men t : TN w r i t e O n S t art D oc u men t ; o p e r t O n S t art Elemen t : w r i t e O n S t art Elemen t ; i n B oolean i n r r r r r r r r r y F y F y F y F y F y F y F O y F y F y F TV essi p r o p e r t y Passw p r o p e r t y R ai p r o p e r t y U serN d ; essi ord n : r ame: st r ar) : B oolean ad eEv en F e r e ad e ad t t en t r B oolean ormali r e e ad F O n C O n C ommen t r e ad F O n r F A t t O n C D A TA a F h arD ec lEv en TN ot i y Ev en t e ad eEv en t r ad F O n t ec lEv e ad t i y D at i on D ec t ot en TN lEv i t t en En Ev L t XM r on t TPreserv ru t i t i on TV c r p ac e esolv eEn t i ot y Ev en t eEv en t r i ad i F Passw e ad F U r e r f ad eEv TProc t e r : w alu g g on eS y n t y Ev r e ad ad F r e R ai serN w r i t e on r i F O n i t e F O n C ommen F O n D oc Ty p eD d D oc men t u C h arD ec l at t a; ; t En t i t y D ec l r e ad F O n N on XM L En t i r e ad F O n N ot at i on D ec l F O n Preserv eS p ac e t i y r e st ad rEv en essi t n oc S O n S t art i t e ru R w r i t e U serN c t i on esolv u men Elemen Passw F e st D n t n art t O F I n ad O e t y t g F r F i t w seErrors ame ec n en w S O Proc ord F e F n O t Elemen t essI u r En en F b w t d a ri at En en TN ; at n eD e eD O p alu z F ad Ty r ; ; oc f t N t en g TD TEn st : en eEv TV seErrors: n ) eEv eEv alu i g t alu t : r i n n ; st r r u : ou st h B r r a: PC TV er) ErrorC e: rc r F at ou em: N y n e(sS e p en on t e p orab n : p p g I t p p n omp e o p t O ; d o p en F TS n i r p eEv e t ou o r p alu i ; p p TV r roy p p w c e p T leW en O F orab on O y d p n omp class(TC co u e = ; eEn t t t ord ; F ai R seErrors; ame; I P T o C s e h a e p C t e r U 1 E 4 . S I n o f t ’ s c l u d p e d a r s e i s a Th e pr o per t ies a nd m ( m c o st on o f st ru F o r t h b d w t ru c h y t o u et h co r r espo or C ea siest il d a I f w c ich en set u est h reat u se, r i n S o A a X ds o f or D e( roy cr ea t e t h en f inish ed. t i o p a n p oO w n ; de f o r ov e pa r ser , e r l o o u s i n w it h er: TC t h omp n t im y u erri y o u a g t S t h A e X C r d on t h e. O en t E m S r P o po a f t ) er w s c o a f f e nent e TXmlO ese co t h f o U o se in t h ne o f desig o u k TXmlParser co dr a g - a nd- dr o p o in co est c r a nd dir ect l y it s pr o per t ies a t pa r ser w l d r i n g b a r e sh j M e s c r i b w n b o el cl a od e d i n . el o w ss) : ; m po nent s f r o ise, u se t h m is co t h e pa l et t e, nst r u ct o r t o se. e; r sel f , do no t f o r g et t o r el ea se it s r eso u r ces Appendix p rop ert F y ErrorC ind t h e nu A: ou m b n t er C U : E I o f S n t o f t ’ s D o cu eg er read er r o r s f r o m t h m ent G O b et j ect M o ErrorC 3 del ou n e pa r se pr o cess w t 5 ; it h t h is r ea d- o nl y is r ea d- o nl y pr o per t y . p rop ert R y Errors: et r iev e a l l t h TS t ri e r ea so n g L i ns f o r st read er r o r s du FErrors; r ing t h e pa r se t h r o u g h t h pr o per t y . p rop ert FN y N ormali ormali S t r ip o u t o O t C h eD ex arD z O eD at t r a e. Tru n z w t h h a: B oolean it e spa ce f r o er w a ev at at read FN ormali z eD at a w ri t e a; ise, ent a l l ( t h m t ex t h t e do cu e def a u is m ent pa ssed l t ) . C D w h t h r o u en t h g h ATA sect io is pr o per t y u nch a ng ns a r e no t is set ed t o t h a f f ect ed b e y t h is pr o per t y . p rop ert w y ri R O t h ich el em rop t ri A t y ri C D t h rop O t N n y O C h D A n o r m o f TA C ert n C a l t ex FO n D t t u n C h a ndl er rop ert FO E n y nco u ev n oc t D t o p rop ri O y O t ent p r eq u rop R ri y t O a s ev n e eceiv na m S t u t eEv en t read : t h a: TV ent TV e do cu Elemen e a nd v a l u on t h a t art e ev i nt ent FO n A t t ri b u t e e, m ev t a nd a ent ent f l a g t h r o u f o r g t h h t h eir indica t ing is ev co t h ent , nt a ining e o r ig in o f h a ndl er . alu eEv en t read FO n C D A TA S ec t i on ; e do cu sect io alu ca u ne ev t : m ent t r ig g er t h is ev ent , w h ich r eceiv es n. eEv en t read ses t h is ev ent t h r o u g alu eEv en TV o f p t h a ec l w e do cu r FO n C h arD at a w ri t e h ent t h t o f ir e. E e su t a ch co ppl ied pa r a m read FO n C nt ig u o u s sect io n et er . ommen t w ri t e b D m TD e m ent u men u pl et e y no t a t io t is o : m TN t t h e do cu m ent is a v a il a b l e w it h in a Ty D p eD oc Ty ec p lEv en ec l; eD f t h e do cu a cr o ss ns t read n in t h m ent t o t h decl a r ed e do cu t y pe, e ev in ent t h e m ent ca u a nd it s pu h D a ndl er . TD a r e ses t h is b N l ic a nd o t e t h a t no t if ied in ne. ot i f y Ev en t read FO n En d D oc u men t ; ent r m t y pe decl a r a t io pa ssed men o u n e o ef o r e t h oc f r o oc FO e na m a r e ent ent . t a nd oc d m l: ri er . Th D m co t h is ev eD ec g En co b nt er ed in t h n on t m e ent ir e do cu t o ri h a s b een pr o cessed, pr o cessing a nd t o t h is ev r el ea se a ny ent r eso u f ir es. U se t h is r ces no l o er ng ir ed. ert w Ty d n i f ed t o o ccu En FO nce t h ev at ent it ies n e O t h ec ident if ier s ent s t h a t ert w t S co eD t r ig npa r sed ev ec nt ent nt er ing ent sy st em u p t ; oc Ty e t e na m ns f r o a l a t t a ch O D t h u TA ommen ommen t e; a; Th e ent ir e co p S A arD at t ex O TA t t es enco u a ppea r s in o y C u nt ent s o h arD e: u ef o r e ATA sect io ert rop b e ent ir e co FO t b a r e pa ssed t o C FO u ri e a t t r ib e, n e b t a t t r ib f ir es v a l u ert w p t n ent . Th t h a t p A FO espo nd t o w p n e En FO n d En Elemen d e no t if ica t io e o f t h ent s b e el em et w t : TV Elemen n o ent een t h f t t h is su is o alu eEv en t read FO n En d Elemen t ; e end t a g f o r ppl ied. Al l a n el em t h e co ne a nd it s co r r espo ent t h r o u nt ent nding O o f n g S t h a t t h t h el em art is ev ent . Th ent Elemen e a ppea r s t . 3 6 Appendices p rop ert y FO En U n O n t En i t t y npa r sed t r ig g er t h i D t y ec D ec l w ent it y is ev p ef o r e t h rop ert FO y n W O I h H e O g n n n I D g w ev er , t h a v Ty p orab leW it e spa ce o u o ert FO y n O N n on Th is ev p N i t m pr o v ide so ert FO y n O N m n ot N ev ent . S ev ent s a r r iv p rop ey b ert y Preserv F O ir ed p rop n p ea ch p n g I n Proc essi n g I Y p O R n R if n g y O t rop eEn y ri t n S t D i t h h En t XM at g n t y pe i L ident if ier s, ent s o ccu r a ppl y . en t read orab leW h i t g nl y a v a il a b t h ent is no t t y En M i decl a r a t io n ese ev is no t if ied t h r o u Ev t L i on t h w D at y l e if cu esp ac h t h is ev ent . e do cu ent r r ent l y e; m a v a il a b l e on is enco u lEv en ec l; D read in y cessing e do t ; is o ccu it h ec i en t ent it y nd t o ot t h ey eEv I e ent it y N FO n m ent nt er ed in t h e r r ence a nd per h a ps o u r a ppl ica t io t read inst r u ct io ident if ier s f o r cu eS p n. ns t r ig g l a t er u er t h is se. Th ese t y pe decl a r a t io n t o ac Preserv nt er ed, eck st st ru c ct io t h ru c t i on t i on t eS t h is e el em i on w w h ich eEv en ac e; p ev t read ent l et s na m e a nd cu ent y o u o v er r ide r r ent t h e set t ing , : ri TProc t essI n st rEv en t read e ; n f o u n t t w O e n S FO art D men t n e el em t h oc u t h a nd nd in t h t h e t y : l u u TR a ct u esolv t e FO n t io n f o r R e do a l cu co men t w e st a r t a l t : ri t o f b r eso u TN e m ent m m t r ig a nd t h Elemen f o r t i t y t er na l : TV t r ce t o i n ea ch el em alu Ev t i f S y t a g er s t h is ev a r e su ent . ppl ied a s y t read ; t h r o u g h t h ident if ier s, y is o u ev sh ent . o u l d r ef er ence. Ev art new eEv en t ent it ies en D t read oc u men e pa r se pr o cess, Elemen enco u t eEn l ic a nd sy st em ot FO eEn esolv ex e a nd it s pu e a ct u oc art t a g ent t ri n in pr epa r a t io n f o r art S i y r eso e o f nce a t Th e o pening o f n n eEn t a ppl ica t io ert w I inst r u per f o r m art ir ed o r ent ir ed. c e na m o u e enco u ru r n t h y L on t h n m l ic a nd sy st em e pa r ser . TPreserv t st r et u F n t h XM f o r e: ri n e ent it y ’ s na m S n a nd sy st em ent r eq u essi esolv ca n n alu t h is ev o ot b t h nt ent r espo FO l ic, ac w a ppl ica t io esolv ert b ent en t h FO e ich no n- X TN t read do cu pu FO co N f o r t et er s. y n t n en a e e, ent it ies a nd pr o p iv rop p Proc t a r g et o u G n pr o cessing ert t h no r ed is o on FO l: pu e e f l a g essi FO h set t ing . C y rop TN e e ev eS el em Proc pa r a m l; h e ence, ppo r t y en ec TV t t ex l et s y o u e, ac n Th e : w e: ri e ig . H t ri ef o r e t h eS pda t e t h a ch y ec w sed b ert E D e na m FO FO a l su l Preserv f o r O w ca n b a ck on pr eser v a t io n f l a g a nd u no r m ri o f lEv D et er s pa ssed in. Th t o ac e t y ng . FO n ec t it h in ent esp er ed w ec ns u e b t TD i w g i D a v e t h el o t el at on D i e pa r a m ac D y e ca l l b ot i Th e no t a t io t h t e l ev at i it a En i is t r ig ent . Th h y t w l ev ec esp t h a t L t t En pr o t ect ed pr o per t y XM En ent do cu rop L t h t side o f e f a ct on XM i n e ent it y ’ s na m m leW h a nd a ppea r s a s a rop t FO e t h eD is v a l ida t ed a g a inst p e e f r o oc n orab TEn t decl a r a t io ns ent . S a nd no t a t io n na m b l: ri u do cu en t t ; se t h m is ev ent t o init ia l iz e ent . read FO n S t art Elemen t ; nt er ed. R ent t r ig eca l l g er s t h is ev t h a t t h ent , e a t t r ib u su ppl y t es f o r ing t h a t t h e na m el em e ent Appendix h a v e a l r ea dy el em p rop C U E S o a ppea r ed in O f t ’ s D n A t t o cu ri b m u ent O e ev t b j ect M o 3 del ent s pr io r t o t h eir co 7 nt a ining ent . ert S A: y et Passw t h ord : is pr o per t y st t o ri su n g ppl y read a FPassw pa ssw o r d w h ord w ri t e en a ccessing FPassw do cu m ord ent s a t ; F TP sit es. p rop ert FR y R ai W h ex ai seErrors: en set cept io t o e, Tru ns) t o b t h rop ert F y o r f u n c t i U set , G u n c t i e F m e su u n c t i S on im L oad ing F , u int t h e co f o r g e C m t po sing int o t h m nent et po t o r o v ar b e 2 XML e Tf D O M : TXmlO et ls. a r L i n p g c D I ni ti al i t oc u { Lo an g n ai D ou d p O th en M od t len i v ePag e L B – ou rc er) F g st g M e: st TP U o c u m e ri n g ) t L eck h t h ar) m u il d t h D : B FU t h ey a r e serN ame; is pr o per t y . I f nct io n. B Th e oolean nt ent s, index ; inv n m e r esu oolean in m e sa m b de, em e X j M o a y k b ing t h l t s if e eit h t h e er a e pa r se in t h e l a t t er i ame; len i len ame: oc u men t ; l f or s le(F i len ame) i ; } b j M od el. C eg i n U d e; ; o r y , M m L r et u st r i n di reat e(n l) ; s p l v iew el cl a od a s sh o } F at e t h l t ) . e Errors pr o per t y el ph i co in co detai : p ise, ; f u co . A Tru ent (F D de i M g : it s po nent w n in L nt. oc romF O t it h r ce specif ica t io R e TXmlO is is a F D n t h is pa r se e so u PC . Th oad e ri e w ri h } = er w r ning e o Tru n M cr ea t e it d w iv t h ( t h e def a u . a nd h : t h r o u 1 do cu ca n b O document L th t o g ) ; el; ame XM ems. y o u D er. ce TXmlO sS ame I D ls; es. ate t ew ai M eg es t O ince t h e n. O r e. sh tanti n em: i O I M = D . p w ns = c : L t f a il s. C e I n it document- n ou serN ser se. j our F : u b i I o r D s u essa g TTP oad et : e( L D L x n f a il u o r i t e i e. S ing th XM rv t s” . mou d pa r ses a o f t V e e. . S L c z y of t D document A i rc E d { t ri f a il ed. ( o r po ses, U rmXM men Load memS lg et h e a ppl ica t io FU a specif ied it emory a f t er u XM I w t h read m rc ent n( s) pa l et t e, d ce { : g d False if e pa ck a g f r ee it Load p e C I a n H ES n pu t h n on w ou m o r is m U pa r iso u Listing A-2 { e, t h ( ccess a nd False o co b seErrors t o ent s a s necessa r y . Th ParseM th o r 9 ai ses pa r se er r o r s ( TXmlParserError specif y er r o r aS e r ea so il a r l y , su FR e pa r se pr o cess in er r o r ErrorC cu cceeds a nd a t h sg a l t o do f il ena m ca se f o r f “ an at e a ppr o pr ia t e ev l o ca l l t s t o z er o t h ri sit es, ErrorM ParseD et r iev st TP indiv idu es f r o on R read ca u dir ect l y a nd end t h ame: def a u et et r iev r a ng f it on R serN a ccessing no t oolean is pr o per t y e sent t r a pped int er na l l y p B seErrors; ay } er y ss is t h o u f r o m C e m ca n dr a g ist ing A- 2 h a pt er a in ent r y 2 it . D f r o o m no t 3 8 Appendices t r y { S up p r es XM L D O M . N { P ar s e n t i f f ai e d ; n . L oad D at t i on C reat d . Tex s tr d Elemen t XM ally t rv R L emI th e l em do cu m XM L . I t ems. En d U d at e; el eas e D O M D M ree; . F n t h o f e m t h it enu e D e dd ct f r o m a D O tr u t esp ame) t h Errors. ee v men alse) i t h b e g i I mag S elec d ; = w d : esu d i R A n st n d ; A dd th io u . t h e A d Th e l a d e ac e. C h t ) ; ec k ed ; n Tex ] ) i t ew , i } n ; l) ; er l et s y d t h h e L oad L (Elemen rv XM esu lt d o eI d d ex t e D g e no th d u at aS ou r a ise O men t h e co t h t o rc a n er w no t h m ex t m e e N ise, ent , pa ss t o des t h a t t h co ormali et h o cept io pr o per t y , t e d o r et u r ning n it h t h new l y w t h e e r o u z n t h eD a n : t h e no o t o w de ee v i ew } od e; A ld O t Elemen t : = O rd : = I mag eI n to th i ems. d ex t y pe N e; ; t o r ent cur r ecur e I ce d u r I n d ex : D i sp lay N ew N A t ri od b n el ement s e Elemen A d d I n t eg N ame: th r oug h d C h i st r b ; s: TS g i L tr eev dr en g e; n e n i od ri ; ToTree(N TTreeN st ; . ex l d t e: t (Elemen ch er; a j ect l ist o f cr ea t ed t ine t h a t e t r ee v iew u ist ing t r a ct det er m e it s a t t r ib t h t ine ( see L r et r iev od I u a nner TTreeN ) ct io n o f ToTree r o t TTreeN : . ex ed at False e b u il ds it . E a m 3 w h a t t y pe l displ a y a ddit io is ca st t es. j ec t ame: st (Paren t , t ; r i N n g ; ame, Elemen t ) od e: i ew Ty p e) ; and } TXmlN od e; TreeParen t : TTreeN od n ) . I nit ia l l y ea ning f u ines a ch A- 2 r el ies o n t nt a in e o b s. tr t nst r u ener ic m h e t L ca n oc pl e, a nd ) ppr ess t ex e. (Paren Elemen D pr o per t y . t h Elemen to su e specif ied do cu o u ef o r e a ccessing ement t y er ea f t er , ing th o u e is t r a nsf er r ed dir ect l y a m ir ed Elemen t R g s ex cl a ss b TXM lt en t e v iew ca se e pa g r eq u R d : L o . D Errors n t h . b : d t i ar M i ame; e t r ea t ed in a is 3 A F r L a l l ing t h a t e o em XMLE n . C I n e pr ev n T o M t h t h a t io g v XM en l o a ds a nd pa r ses t h e ca l l s t o Elemen e in t h a ccessed t h r o u f o r i O f a il s. e t h r siv n p len h } it e spa ce. Th is v a l u s ik A { i oc (F d O e(F e M an p rc . O p e u th D Ex th ressW len . Listing A-2 n L i ] a ppr o pr ia t e su e to 0 ent , inf o r m e F e ems[ e no des ca n b b = t if L u : p [ I p t h e t r ee v iew f t ToTree(XM cl a ss t h pr o b { Error, uctur S e( . h del v a l u oad p ou L o w e t h . i ; d r ecu aS M ep st n = O y rv mn : c dd t } a } oL d ace? document (N A p D S v a l u u at eD L A nl y o s z ormat pr o per t y m te F An it em o i Ex se t XM h e { { n th ed i e w XM o r s ormali e) ; t o na l it s Appendix { ar b e ct v x n u E f tr act o n PosS t art g i R esu f ame, er; D Pos(N ame, = t h t art + at PosS t art ' o cu om a s m D tr ent i at O ng a: b j ect M o 3 del } st r i ) n : g st r i n ; g ; 0 : = PosS : = Pos(D C y at a, d = 0 op (D PosEn i f e lse ; esu R G ener at a) ; n lt : = C op (D ' y ' e name f e. N od eTy p e [ TEXT_ N O D E, C O g i i f t h (N od art h = L a[ t t : ate od PosS lt esu N e ; d n r N ' art i f n eg f t ’ s D st I t o ue n = t { al r(co : PosEn g v S t = PosS d e d t : t n b ute oA : art i e f PosEn b d E t Ex R i , i Pseu U lt PosS i e attr et C n PosS b an G i A: en g t h , L en g PosS t art 1 , ame) ] + art (N t t h (D + 1 + 1 ; at a) , PosEn ) ) ; n a, di s p l ay i n O C D or at i n M M EN T_ N D E, e. N th e A TA _ 2 0 t od eV ee EC TI S tr d – 1 O D E] 1 7 ) v al g t h – eV ) ; } O N _ 1 , N t h e n n L en g od eV alu e) > i sp lay N ame : = C op y od e. N sp lay N ame : = N od e. N od eV alu N od eN ame; D e (N h e n alu e, + ' . . . ' lse D e n e lse i e; d D i sp lay N ame : = N od e. C r eate s tor ag e f or l ater b j M od el. TXmlElemen g L i st . C reat e; n { case N od e. N od eTy EL EM EN T_ N O E: w i t h b e g i n A t t t r y N D od e d ; n n b u t es t h : = 0 t o A t t b u t es. es. I t em(I n d ex es[ N od ame] asA t t ri r I n d ex t h A t N t ri b u t ri b s. V alu : = A d d Elemen Elemen t . C B aseN od A e L amesp n ally A t d ; O ri b ac s. F e, t D E: N od e as TXmlTex N ew N od e : A d d Elemen Elemen t . C D E: S TI EC = e(x t s) ) d o t (TreeParen t , D t Tex t , ' S ec d d Elemen t (TreeParen Elemen t . C reat N O D ' TA A t TXmlC : , as ' e e : ' PR , S O C ES w i t h b e g i N ew = EN C E_ = D A d d Elemen t . C reat ' ' , n i l) ) ; I N G _ U C TI O N N od e as TXmlProc N od e : A d d Elemen Elemen t . C ' , N S TR I o e; lay N ame, ame, ; t i C on D d at i ' sp lay ' N , ame, ' , ' D at , D i sp lay , ' ' , ' ' , lay N ame, a, N ame, n t a, ' (TreeParen e(x _ En O D N t t D at a, st i n od I i N g D , R , y t t ef i sp e. N od eN ame, E: essi n ru c t (TreeParen t , D i on , on d o n ' TXM ' , L ' ' , = D at a, t reat n i e(x l) ) t ; I n st l) n i ) i ; o E: A ' t e(x Elemen L ' O e(x e od N reat od N _ t od TXM d alu sp b N ew i ri N N od D t A ew ER N , t , h EF = t ' N R : eN ' 1 o od t _ en d N i TY L ) , w TI } o t _ EN d Elemen TA L N eN t (TreeParen A TXM O ues ree; h D ri ame, N L t reat t TXM e t i w C node ri = TEXT_ i of t o t ay TS TXM n l : H N p XmlO f ew s as s N di f e w e o b f i e ri i f p ru c t i sp lay Targ N et , ame, l) ) ; 9 4 0 Appendices C i f b e U p i n g e n ; erC ase(Targ et al i { S p eci ed t V ersi ed t En c c b x S t an S t an d ; N O D r, t as TXmlC ew N od e : = A d d Elemen Elemen t . C reat L ar ati on G et Pseu d oA t t r(V ersi : = G et Pseu d oA t t r(En = (U p p ase(G ) = Y esV D at a) t d decl erC et c } on A t t r, i n g A t t oA t t r( od Pseu alu e) ; D i sp lay N ' ' , ' ' , XM L D oc D esc D oc d D at r, a) D at , n ; a) ; N O D o t , ' ' men t t , i t h N od e as TXmlD b e g i N ew N od e : A d d Elemen Elemen t . C ommen t , , ame, D at a, n i ) l) ; E: oc u d o n A d d L = Elemen t t reat ToTree(D t D Ty p e, men t Ty oc n d ; C U M EN T_ w i t h N od e as TXmlD oc b e g i n ed t D oc Ty p e. Tex t : ew N od e : = A d d Elemen t . C f o f o d ; TY PE_ N O D TXM L Elemen I n d d Elemen t I n = r d r ex d : : A d d Elemen _ N O D TI TY w t h (N i f N ot b e i n g oc u men t N ew od N , XM L e) ; D e u = N i np p e d t En t , ' i es. ToTree(En t i t i at i on 0 N t ot o ToTree(N ot at TXmlEn i t ) , ' ' t h D TD D esc , , D TD D esc , ' ' , ' en g h – 1 I t em(I N ew N od e) L en g I t em(I En t i t ' ' L t o , y t t ef i i t En t es. R i s. on s. st g t n t d d ' , ' ' i ) l) ; h ex – ) , 1 n d d ' , ' ' , n i l) ) ; o ; o ex ) , N s N ame ed ells[ ow C , n > enti 0 ou t < R t : ty y ow ew N od e) ; ou R i es d od e) o n } C = e n ow – 1 ou t n t + C ] < > 1 t h e n ; C ells[ 0 , R ow C ou n t – 1 ] : = N C ells[ 1 , R ow C ou n t – 1 ] : = Pu b C ells[ 2 , R ow C ou n t – 1 ] : = S y st C ells[ 3 , R ow C ou n t – 1 ] : = N ot at i on N ame; enti ty = t (TreeParen t , D i ef , N od lse ' o (TreeParen e(x t t on ar C e ' ame; reat 0 as at U n , E: od f e , esc E: = ex (TreeParen e(x e od eN ame; li c I d ; emI d ; d TA TI w i t h b e g i i f P ar ew O s N ed od e ' , _ N O (N : } A d d Elemen Elemen t . C reat ' , n i L ' N ' D , ' ' e(x ) t En t i t y R , st g N ot > ' ' t sp lay eN N ame, ame, ; l) od E: e TXmlN as ot at i on ) t ] at i h n on s d o n C R ells[ ow C ou 0 , n R t : ow C = ou R n ow – 1 ou n t + C < 1 ells[ 0 , R ow C ou n t – 1 ] : = N C ells[ 1 , R ow C ou n t – 1 ] : = Pu b C ells[ 2 , R ow C ou n t – 1 ] : = S st d ; ecur l dr en ; A nd r N od e. H asC h i o r I n d ex : = d Elemen s e t th r oug ld N od 0 t h any o es N t i C h i ld e. C h i e n e. od ToTree(N ch h od N ld e ; C d d n e : XML e = C w A h t T_ n t th ed e(x EN e e (TreeParen M O alu : k t U i V or ommen C n L E: TXM od y od N eN ame; li c I d ; emI d ; L en g t I em(I } es. od es. t h – 1 n d d ex o ) , N ew N ; ; l em ent s h a v det a il s in a iew t eA ec N N v h e { E lon C od R d A d e. N T_ i n lon h { e A t t EN f d Tex i e f . w A i g EN N n n f d O { i od ng XM t M TXM e Tex n O N andl . = M TXM D h on ) e O D p er u nit , e t h TXM L eir a t t r ib Elemen a nd do u t es no t t es co o b nv j ect . N r ef er t o er t ed int o o t e t h a t t h a t h st r ing is is a e TXmlElemen l ist l o t ca l b t h e cl a ss def ined in t h ef o r e sa v e cl a ss o f t h ing e C U a l l E S o f t Appendix pa ck a g e. Th cl a ss u se t h t h F F igu r e A-2 igu r e A-3 e na m e o a n el em ent : : T D e isp x l a t c o y e l o ca l it s u nte n e nit , nt w l e ith U m E XmlO e in th b j ig u v ie o f t ’ s D a ccess t h M od r e A- 2 nt. e S o cu n r epl a ces t h o ne. To a r e seen in F ing a C def init io e int er na l f A: w e r . el. . e ex e o r ig m ent O t er na l b ina l o j ect ne, cl a ss, TXmlElemen t . Th M so y o a l l o u 4 del m e r esu r ef er ences t o u st pr ef ix l t s o f pr o it 1 t h is w it h cessing 4 2 Appendices Tex t t y pe no co nt ent ex a m sim t h pl e o f il a r o b des, int o t h pa t h , incl u ese is sh pl a cing j ect . A specia l e o f t h e v Th e do cu m a ct u m u a l l y st igu r e A-4 : t h e il dr en o g inf o r m de, e g r ids o T h h f t h d o nt it y c u t h e do cu em w e do cu n t h e nt p a ng . S r siv nt ex t o m ent s, r o cessing M in t h L inst r u e da t a l a r do cu ent pl y f o r co py l a t er ct io h er eb f iel ds o u t h y t h eir se. An ns f o f iel d o f decl a r a t io n w pa r t icu sim t l l o w a e st o r a g it s pseu n t h e do cu e do - m ent a ny n f o r ent pa g ent no t v ie e de in t h a nu n a nd u e do cu e v e C U a l l y ent m e E co S m k ig u es f r o m e l a t t er o f t inv o t y pe no ent . F iew pa g D e t h npa r sed ent it y m e do cu e in t h w a ppea r t h t h m n pr o per t ies. Th l ist s a nd m e. Th f o r pa g e t y pe no eir ent e t h a nd no t a t io O no , t des g de a l so r e A- 4 M e nex su sh o t h e a r e no t so y l ev el et o u o f a dded ppl ies t h w s a l l t h e is er . r . w it h in t h e C e pa r se pr o cess. O U E S nl y pa r sed ent it ies do o t h f t D O e r esu no t M since it l t s o f a ppea r w t h ex e ex it h in t h pa nds a l l pa nsio e do cu n a r e m ent ent it ies. ea ch ch e ca l l . Th f o r m il a r l y , f m ent in th r ing im de’ s l ist ina l l y , . P nt ent e X t h e no t a t io el em cu ge r ef er ences do F t h m e TXmlElemen r e A- 3 a nd co it h in t h m el e do r ef er ences du t y pe no co n o m pa ssed a l o r ecu n t h e t o p- l ev a t io e ch t h m a t io t h e o f m a nd it s ent it y t o su u co ig u ist s f o r de pr o cessing . Th er ea f t er , E S o f st ep t h r o u inf o r m F eir ns a nd co f iel d in t h n in F no na m ATA sect io er . t y pe no ch w t h D t r a ct ed a nd t r a nsf er r ed t o iew r est ent o C nding ca se ex pr o per t ies a r e ex pa g ding e co r r espo il d e new a ddit io o f l y t h e cu r r ent no cr ea t ed TTreeN de is pr o cessed ns t o t h e v iew e is pa od ssed a l o in t u ng r n t h r o u t o pr o v g h a ide t h e . mmary Th e C U cl o sel y , E S o f t D a nd incl u O M des a im pl em f ew ent s t h el em e W ent s o 3 f t h C D e L O ev M el L 2 ev el 1 specif ica t io specif ica t io n. H o w n v ev er y er , it Appendix do so es no t m H v it h sim o u m t h t a ny o e D t o u y t h O a sso cia t ed D O t h r u enco u o f it s u E S ppo r t o f t ’ s D f o r a v a il a b it h in y b M y o u na m l e a s D r o cu m ent espa ces, , t h ing en a nd D O el ph i co O w m a ppl ica t io n. Th dr a g g f o r m in t h t h e TXmlO set t ing M b is pa ck a g eco . I ncl u de t h e ca n b it s b j ect h ich M o l im m po 4 del it s it s u sef u 3 l ness in nent s a nd cl a sses m e init ia l b j M od st eps ca n b e pa r t o f y co el pr o per t ies nd ee t h o n y o u r t o t h e e S AX e u sed o e XmlParser u e TXmlParser co r espo nt er ed. S se. U in o u r m t h ex po e a k es it e per f o r m nent f r o m t h inspect o r . ecu t a b l e, m ed O a k e nce ing it t e. pa l et t e a nd dr o p it ca n M e pa r ser dist r ib inst a nce o f o u su ding o u Th e pa r ser y l l se w co nt o pil ed, ea sier ide f u C ns. pl e t o pa l et t e co a t io a v ing er y w pr o v e sit u A: f o r m po . By it em f o r m P s nent , r eg w a sca l n it s o nit o r in y dr a g ist er ing it h in discu t h e w X ev o u o h L ssio n in C r it h t m a pt er m b 4 il ding e co it h ent 1 u t h e a nd cr ea t e a n t h a ndl er s w do cu h o u pr o j ect ne f r o ent M n w f o r t h a s m po nent e pa r ser , t h a n ex ey a m a r e pl e Appendix B Mass Electronic Mail- O Th e pu u r po se per f o r m w it h ts m in t h a ss t h da t a so u o f e a ppl ica t io m a ss- m el ect r o nic t em r ce) e pl a t e t o cu st o n a s m o a il er m a il - o u a r e m m iz e t h du l a r pr o er g e m g r a m t s b ed descr ib a sed w it h o n a l e, a l l o w ing y in t h do cu r ecipient a il ing s. An a ddit io a s po ssib ed ent da t a na l o u m o t o is a ppendix b t em ( ex ea sil y pl a t e. t r a ct ed j ect iv e is t o m is t o F iel ds f r o m a k e t h m a e a int a in dif f er ent pa r t s independent l y . To sev pr o t ect er a l X L co is u a l l o w s t h a ddit io e m S Q m et h f o r m o w o it a nd/ o r E 1 . Y o u e m no l o g l a t ed in a m o u e h a ng r est a s w t h e el l t - b g h es t o o f ch a ng es, it r el ies o n cl a ss: a int a ined t h r o u t h y t . Th e t ex edit o r s. C el ph t h r o u et h o t o o r e po m pl e M a il h w er u m a l ent w a s f o r t h e t em a sed f o r m no r m t h e m pr o er f u q u er y t h a l g r a m , a t t ex essa g t pl a t e o f X M L edit o r s, e t em no r l da t a b L t h e in pl a t e ca n r eq u ir ing o u r da t a r u co nf ig u r r ent r u a nd t h e E D t h l o f ig u r a t io ( S M t h e m y sing y o o u v a o u TP ) is u essa g ) : n do cu m o f S f r o Q L m w a BD E do o st a ny el y a nd g iv es o r r y ing is u e a l ia s. dif f er ent need t o er e y o u a b a o u ser v t er pda t e t h e ef o r e. r e B- 1 e a h ca n b a ses na t iv ed ( t o sed t o t h co m m u nica t e w it h es. ent t h a t n. Th is f il e det a il s t h na m ses da t a b U e m en a l l u m es t h a t ca n r eside in a l m B. b r ce er a l f r eeing ns a s b r o t o co s ( see F L sev a t io n f r o e f iel d v a l u da t a so u needs t o a se) , st il l P O r ce. I nf o r m a nd t h e da t a , e da t a g r a m e cu y a nd ing t h e dispa t ch nnect io n, e u BC t h Tr a nsf er M da t a so u t o ea ns t h a t D w a v ides a ccess t o el d. I f f o r se in t h b m O m Access r et r iev o r k s a s f o l l o a se co pl a t e t o e. h e pr o a il ser v g f r o a il s a r e sent i pr o d f o r a l l y a e da t a e e- m essa g is a ct u Th e a ct u do cu L a f f ect ing r ea d in a n X da t a b . r e t ech e sent e ea sil y is a ppr o a ch er s set t ing s t o 2 t u r a t io n pr o per t ies, b M f u is enca psu nf ig u r et r iev t h t h n m g r a m t em ich e t o b er e t h since D im e e- m Th e pr o e co t a l ia s a nd t h Th e S t h o u h in o t h m BD h essa g sed t o er , a t , a ny h it h ines w ded m w specia l iz ed X w is u incl u co t h e m a g a inst pil e. L To g o f ese f il es t o n t o det er m m t h a de r eco g r a m ea ch sed f o r nt a ining b e pr o st a nda r ds, M t h co e S e f il e co nt a ins t h M TP nt a ining e v a r io u a t t r ib t h e u t es, m s t h e essa g e sed. a nd t h e m essa g ( a s ident if ied in t h 4 e co 4 e t em pl a t e a r e r ea d in f r o nf ig u r a t io n pa r a m et er s a b m a no t h o v e) . er X M L Appendix 3 . Y o u u t h 4 . r et r iev sing F t h e t em o r int o 5 . e y o u e BD E r e B -1 : r eco r d r et r iev t h essa g e m Th e m D a ta er g nu f l o w b th on e t em ed m m X C o f M a ss E l ect r o nic M r ecipient s f r o m t h e co nf ig u m t h r a t io e da t a b er r o u essa g o a f m l o gh g th ed, ser v f il e w e p m er g e t h es a r e sent a il r o h m o u t F o r er s. er e t h gr a e r eq u X S ey u sing S M TP t est ing ca n b , pu e r ev Q ich y L q u Q o u a ccess er y f r o m m t h e da t a b a se w ing iew t h y e o u m t o essa g t a l k t o es a r e ed. MLC on f ig s ML Template age L MailTemplateQ e u er y en d MTP er MailTemplateLog Log ing th e C Th e l o a ding r et r iev ing det er m o t h e v a l u t h e pr o per t y nf ig u a nd v a l u onf ig f em ines t h t h co h 5 . MailTemplateS oad a l l o r po ses S L w e S est ed f iel ds f r o X as a se, n f il e a nd t h 4 t s ML f ig f ile atab u pl a t e. MailTemplateMes D a il - O pl a t e. r edir ect ed t o igu l ist ea ch a ny F r a l ia s f r o B: t h e pr o f r o e na m m a n X es: v a l u e co n f il e in L y m ration Properties g r a m es o f e ( sepa r a t ed b r a t io u t h pr o per t ies is a cco M L ing m ent . Th e h e pr o per t ies, per io ist ing do cu f r o ds ( m B- 1 . ) t h co m a l pl ish no r ing t ex l t s in t h t co ed in a ier a r ch pil ed f r o a nd ig e a ct u r esu m t h m y m it h e f u u o r l a t io ener ic m in t h l l e t o p- l ev nt ent . F e a ccu w t h g ex n o f el em el e X a m t h M ent el em pl e, a nner , L ent ) , t h f il e pa t h e X t o w M it h L ese pr o per t ies 4 6 Appendices smt p . smt smt d h p ost . p u . at =mai ser=k f l. ei rom=k b t w t h i n t h ood @ ab ase. ali as=mai set t i n g s. p au seTi set t i n g s. t emp lat est i set t i n g s. t Listing B -1 : < ? x m l v ersi < m ai lT e m < < p p =" X M L c 1 . 0 " ? > l. t h i n g i es. o mai > < u se r > k ei t < / u se r > < f r o m > k b ood @ t h i n g p > emp < / ali as> 0 < / p au se essag e. ab ase > ali as> mai < u se r / > < p assw o r d d at ab ase > i g se t t < p au se < t e m p < t e se < / m ai n > r a tio n f il e . i c om< h o st > om< / f r o m > T i e > x ml< / t e m p lat es. c / s> m e > 2 e > M ai lM st i n g > Y < / e t t i n g s> lT e m p lat e > T o u t t a k 0 t es. h 0 st i I t en t h . I n t h g e o a l so ey is w b t h f u a r e m a y , m > e > n es a dv a nt a g v a l u TD ml t h e st r u il ds o er el y e t ech ct u n w t h r e inh e a b el l - f o r m niq u e is g er ent il it y ed, o w it h ener a l in X f X o u t eno u M M L h g r o u do cu r eq u g t o L m ir ing t h a t it p r el a t ed ent s co co u t o nf o r m a l d b t h o n e a t e d v a a t o o c l i d u n m e v n h i t h t e - l e T w w p . r e f f i c i e l t c e r u nit , sing XM it s V l a t er o L C e na m w it h e o f t h i g t h oad o c t , a f o l l o s c u u e m l l e n n l e s s i m e D w t . t m a n T h m p t s a h a l y h D i c I n a nce e r eu a n d e n v l e , y l l o e m s n s e t h t c f a e a w a i n m c f o c h t , t s n w c g d a s , e i n o e n n s , d e o e a l l - f o v e d t h e t t r i b r m n t a e n u t i o n s i n i t i s g t e d s s o o e a c u X r d d m d f o e m n p nct io . P r o per t y per t y , Prop na l it y pr o v ert i o f na m t h e pr o per t y es a nd v a l u iding a sim esFromXM l o a d a nd a e pr o per t ies f o u Listing B ce ar p o v O en -2 th : d u r e oc : e C o nf igu conf nd. J u ur st romXM D oc men D ex I XM I n t eg L er; R ecur P r op er ty ( s ep ar ated O M D s i v el y r ead pl e w r ef er ence t o a y a nit l o a ding y t c d p t s . t o e a a r r e is pl a ced int o es a r e pl a ced int o t o pr o cedu L a dd t h is u t r tie e s f r o and L (F r et r iev r e ( see L st r ing t o l ist a no t h er e t h a st r ing em b ist ing y B- 2 a nd f il l s t h pr o j ect t o ) X en M len l L. oad ame: st th e r i n p l eav r ; g er ti Prop op s: es } TS t ri n g XML document th accumul p er i e ) . unti ated l tag s tex t to th i es s ar p oi e nt r each ed. s) it s l ist na m e t a k es e l a t t er r eu ; s ods m th i i name b u l e f i i p esF ert d r o on Prop L : ati n p oad I { g tio L XM n i r a – e e a e L r , y m M e il it ies. r sed . e f u e f il e t o e e w r i b m r k t h f es pr o alu n. Th e L t h o se, on r e c w n t o p o l d e s d f u d m D e s e e l e i m T t h r m e l a D i n f o l l - f o e a id in it s r eu n u p e er e. l l l y { b E c To / i h T lt lat D e h w < < x > e / / e. nf igu > < a b l e t e u essag =Y r at w 0 lM st t h o 0 o d s u 0 ai p < h om < O w c > el sew b g es. o a I f e=M i emp p t n g lt me=2 m on pr o cessed w o om h sm e n a lat pr o per t y N n c t Th is l a y R i es. < / t o i sm < / S g h ; se it s Appendix e o ce u e L oad S u b Prop i x : st r i n t eg er; e es b ty th ar er v op dd r r A p P d Prop r I n d g i n w i v Pref I t h Elemen i f (N od n d g i n XM L D oc s. C XM L D oc { R ead t h f o r i e n d ; i n ; D s tex t. us ng i ts t I XM t i es(Elemen : V al ues D O N L M p od r op 4 t s er ty . 7 } e; o p e = N O alu es[ C op y eV alu e : 0 t o ert i r I n d ex L oad S u : E_ TEXT) (N o (Prop r Pref i od x eTy , 2 p , e = L en g g t h – 1 n d ex ] , N t O h D E_ C D (Prop A TA Pref _ S i EC x ) TI – 1 O ) N ) ] t : h e n = b = Prop Prop Pref i x C M D oc u men (F i len oug h each D oc u men : = 0 t o ert i C N h ld ' . ' + . C reat + ld es(C h i od i es. L en od es[ od eN ame) el el N N I d o ; = oD O t e; lear; XM L L D XM L D oc r I n d ex L oad S u : . b Prop n i = t ine M D h ame) ; s econd t l t C od ev Elemen h i N h ld es(C ld d i ement and p r oces s th em } o es. N L od en es[ g t h n d ex I – 1 d ] o , ' ' ) ; l; it sel f oc u a l l men t h e t h t ine f o r b inst a nce a nd a sk s it L no des oad e f o r e t ex em a n S u t o o f b o pa r se t h t h e Prop m ert t t h no e pr o per t y de, w edded ch h ich u il d no e M icr o so f t m ent m X M ent u p f r o m g t h h e na m r ecu t h en st eps ca l l s r o u w es o f r siv pa r ser , a nd e pr o per t ies l ist ed t h r o u L ent . I t el em o n ea ch . Th is l a t t er in t h il t is a ch iev t h do cu es, i is b f e specif ied do cu a in des a nd cr ea t es a n ent r y e na m t o , t r e, t - t y pe no nd. Th cr ea t es ch il d pr o cedu l ea ding r o u oad oc O g t ex f o u L r D int er na l f o r . th r o u t h r o u h en o t h t h e t ine t est s ne is e el em e ca l l s t o ent s t h is sa m e des. I P F r e a e u w M ) i i u ; d Th e T l ert g n actual ng a il - O ally XM I i l ect r o nic M y f n e tr V od o Prop w e d th s a ss E ; e t s a M lse f e t eTy s. N i nto : e ue i ex Prop b al B: h ail M i n t o g m e u a n p t i c z e t h a e l l y r o w h e essag O nce t h o f t h do cu u L m r et r iev ist ing B- 3 ? x m l < t e m p lat < q u e r y < su b j e < m ssag e v M i n r e m i t s v e a t h n t s r i a b e finally c t h e l e g r e o e f e s r e o u n t l a c u s e o e f c s c o o i s u p n e n t o f o t s t r i c r a n t l y i n n t e e c r f a e c s s e a a r y n : X ersi r a t io n pr o per t ies h a v e t em e l p e h i s i t . h o l ds t h e t h e b een l o a ded, pl a t e f il e a nd l o a d t h a t , e t ex t o f t h e m e r ecipient s a nd t h M L m a =" 1 . 0 emai lf i eld il -o on " ? u t te m p l a essa g eir y o u ca n ex t r a ct t h t o o . Th is f il e is a no t h e t o b e sent , det a il s. A sa m a l o pl e t em ng w it h te lA d d C ome v i si =" t y ou r n ew > D ear < f i ld > F rst e Emai t h pl a t e is sh . i N ress" W > selec t si t / ame< i ld eb / f e e< > , * su f b j rom e ct c > u st omer< / q u e r y e na m er > > ct e D f r e > e . d . -3 < n t h a t sed t o Listing B c nf ig u essa g ent O e e Template e co e m D d > X e q u o w M e L er y n in 4 8 Appendices O u A s r < w ou Y K < / n ew f i W eb i n d ou rs si n c ei t h W < / m e ssag e t e m p lat > i f e t ld t > si ld Posi e F ir st , somet erely s < / h n g i u p f i e Q ent . O a nd ca n L q u er y h ich is t h ise, er w r et r iev a il ing s – j u Th e su e m b co e co e m ea su m h a v p e { I b e g i F n h d Tw al e r XM i D L ere. C t t p omp t oc D oc o i z o n : / / w an y < / e i t t h f iel ds e w w f . i t e emai r eq u t o f h i n g > ld i w es. e t c h om. i n k y ou a l l d b e co nst r u t h e da t a b r es t h a t k t h no w t h e j t h e w h e a ppr o it h t h e q u ery essa g e l e f o r it sel f . t a r g et ed er y . it h ning w it h in t h f i t h e b e S el em eld Q L o e l a t t er q u dy y o u ent s, pr ia t e po int s in t h in t h e a il e t ex er y , so t . no er e. e m e o f a se q u r em da t a b m o ent , ent . W po sit io ne w e q u el em t o f b e- m pl e a s necessa r y t h a int a ined b S Q L er y a se t h in t h a in sy a ny ne w e necessa r y m ent r o niz ed. no t o ir ed. To e do cu nch a r e y is r eq u ct ed pr esent ing o t e in ec y u a se a s a e el em a t l edg e t w f o r se needs t o r ecipient ’ s a s sim se in t h b pl a t es ca n b inim u u e a t t r ib o r f o r e su e do t h eld e da t a b h is pl ex a se b es ca n b e t em i m e messag e necessa r y a v ing lf a se f iel d t h a t se ere cl a h displ a y , t h u ir es t h a ppea r s in t h l d b da t a b n’ s e a s co it e f iel d t o det a il s m ent nst r u on C d incl u v a l u a l o in a es in ng As a ded it h h ide a w it h secu t h e X r it y M L t h e p ac co p C (F t h t r esides in it s o is t o l o a d t h co per t y it t o w t h r o u n u e specif ied X nt ent s t o do t h a ccessed g nit , h M t h ai o f t h e ensu Tru es in t h e t em e f iel d el em e M L r es t h a t pl a t e. I f t h f il e. Th do cu y m r m TM e M ai l- lat e- icr o so er ea f t er , ent . o u t h e lTemp e cl a ss cr ea t es a n inst a nce o f pl et e a y a nd S y et t ing essa g is pr o per t y f t o u t h e e a ppea r s w a s l ef t a t ent s is l o st . lat eM essag e. C reat e(F i len ame: st r i n ) g ; e; O M reserv load h ich e pr o e w lTemp oD m l o a ded } ai reat = w ct o r est s t h e sa m TM is cl a ss, e eS t h ati : . nl y t h co u do cu t o r . e o e da t a b a t . H ensu g h ca n b a il o u it e spa ce nex oc D L h > f iel ds in t h sh a nd r eq u h h ct t essag a il u L XM F n n XM F e i h e f iel d v a l u iew I n it s co eW ti r v L eM w er ea ns t h a t a l o M e e- m st at pl a t e. a ccess ni n e e. False, m t h m e t ex X reserv co ld specif ied in t h se f o r m pa r ser , in t h e e f il t er ed o u e o f o f er y , t h lat L g i a ppl ica t io g er y edit o r . A m e t em essag M n f e t h r o u e e- m eing L L q u Th e X i < de a n a ppr o pr ia t e w es f r o M M r e, Temp n erest t h e q u b t h e na m X essa g essa g M e b pl e- t o - u t h t f o r ne pr o cessing X pl ex sim m na l o r m a o f a t t ing sing t n h a t ev incl u t h f o r m a ddit io t ex i t h w st v a l u nt a ining U of n is specif ied. Th do j ect essa g ca n inser t Any of , ecipient s ca n ea sil y t h ru > ident if ied w el em o f d ld > t h e S a ddr ess, m an e ood specif ica l l y R i on D eW i oc h u i len men t eS t p ame) . C ac reat e : e; = Tru e; a ccess t o t h ; ; o m do cu m et h o ent ds pr o ( see L specif ied el em ent , r o u es t ine do cu r et u m a ssu ent , r ns t h o ccu a t t r ib m e v a l u t e o r no f t h ide ea sy B- 4 o r e o f it t h e el em de do ) . N a n em t h a t a nd t h a t r r ence o u v ist ing t h st r ing o nl y nl y ent is ex ist . m if o ed a t t r ib is a ssu e el em e r et u alu nt a ins o e na m es no t eV pt y er e co od a u ed, t h ne ent s a nd a t t r ib r ns t h e el em o f a ent ea ch sing l e t ex t e o f e t ex g iv a nd a n em t y t no t t es w it h in t h nt a ined w u it h in t h e nd. Th e ca nno t pe b o f de. A en el em pt y co e f o u el em t t ri ent b u t ent . Ag a in, st r ing is r et u in eV a t h e e alu e sing l e r ned if t h e Appendix Listing B { R etur as f -4 u s n e eN b i od ar ct N i e e v onl y A t I XM s: t lTemp st . h = esu lt : = ' ' lt : = s. i n o n i n g r i i t th e v onl y umes TM ai a e. A ) n ttr ib attr i t u l ect r o nic M te v b ute eV a l u e a il - O u t s. - ri b u t r i n g ; sB y Tag N es. g et amed I t em(A i en } : g st alu e( ; t s: I t t al em[ ue 0 g ] of one Elemen 0 t h e n at t ri b . et th s e uch lTemp lat XM u t named node eM t essag e. N ch eV od eN ame) ; t ame) t rN . t ex t ; - no od ame(N N node and L D O M N od eL i st l dr alu e(N N od eN ame: st r i n ) g : ; XM L D oc . et Elemen len g t h = 0 t esu lt : = ' lt : = Elemen s. i ; F s. d = t lse : e s f Elemen i R I n esu b o t h do cu m r o u ent l ist o f r et r iev e no u t y o u l ist , Listing B P ar s e n ct i o n i n g -5 r h th : e e et h l ist r f o ai t sB y Tag t ex t ; s r m h ag e ame(N lat pr o l ish od eN sB y ame) ; XM v sing l e r esu des y o u en it s v a l u e X t io M ides do r sel f . F m a and il t r m e is f u etur essag e. e w it h t h et h r o t h u m ame is m m is t h o e l ist , n i ts na l it y ( see a pping s f o r t h e V a n ident if y v al ue essag i eld k t s: I L D O M N od i eld V alu e: st r i n g ; I n d : I t eg er; g i n s : = F XM L D oc . Elemen t s. len g t h = EM ai lEx c ep t = ' ' ; Elemen t s[ ex Elemen i f R esu w i r ai t n se t h f o lt : r I n { A dd i i st s: TS t ri eTag ) ; EC TI n g s) Elemen 0 t h reat . C c i ld d o 0 t o tex t el ements N i ld h i t e n h od R esu lt F or ' ld N : f i es[ h I n d ex od es[ I n d R esu lt d' el = el e on ] h O N ) ; et = (c 0 g i : ex (c f { d eL t sB y Tag N ame(M essag n N oM es. len od e(N di r ectl essag g y t e) h – d o } ] . n od ex ] . n od eTy p + c h i ld N od es[ I n g et th e i ements 1 eTy p e = N e O D E_ N O D f d el = TEXT) E_ C D ex ] . t ex d v al o A ue TA r _ t } e r ns t h is ea sy r r ent ey . ar F t h o u e t o S t h e ns. Th o e ist ing es pr o alu ing L e cu ; Elemen it es y ed po sit io } e(F o f e pr o cessing . ParseM d t ine r et u d sa v a r k t h o is r o u es in m sing et h t e. ent nct io e f iel d m r ge m f iel d v a l u t h v a l u a t t r ib cu N a l l y , l t . Th e o r L n o f nt a ins t h t ex Tag ir ed no de. Act u a e no t h t ed a nd a ccessed u e eM t h st it u co Elemen e r eq u ing b et pect a nd t h d tag lTemp g a l l o l v t h a t ing th e ex e su o . r n t h g inv ] t h a sso cia t es a mes TM 0 int er est it y m e ich P em[ nl y t h r o u f st r ing w n se o pl a t e a nd t h a e t u a pping s a r e est a b st r ing st b de o essag a ccept ing Th e m o u a in a ct iv e t em ParseM y t sea r ch ing e t h h ca t e a nd r et u des, Th e m essa g l o g ' t ines t o no pr o cess o f e 9 n R b 4 t s ; Elemen v i oc s g u eL od t Elemen f N D ct { M g etur st m O L R n a D XM ; n L len esu as e i F d e r a ss E } essag st s. Elemen b eM nd named node ame: = R ar nt a rN t lse v lat e e uch : e u t m th s s R f of Elemen f { ue l e M n i n ing e one ai t v al TM n Elemen e tr ie ame, o Elemen g R th umes n v : B: : f B- 5 ) , r eco r d. per t y o f a 5 0 Appendices e i f (c h i (c h i ld N od es[ I n d V alu e : = F i alu e = lse b e g i n F i eld i f F eld E r { i r f e e d o u g et co Elemen ent s, F ormat (M i i eld V R nsist o f t ex f o r t h a t f iel d f r o e t ex t r a v co r s if eing n e n od eld s. V alu ' ' t e n s uch l ace V alu e : = lt : = esu lt R emp h ] . n f i el i on . C n F i eld , Emp t y t h i el d F i ty f ' ' eTy p ame es[ t g od eN ep = ep t h e c d h = N eld ld N od i i O F D E_ EL Tag es[ ) EM t I n d d ex h e EN T) ex t ] ; ) ) ; an d n ex ] . t ] t ex t ] s tr i ng } reat [ e( c e e = h i ld N od es[ I n . n notati on w i th emp ty } ; + sB y messag Tag eld V alu t no w h m t h w t h des, ich n t o h e; t r a ct a pping . N m a l e m a nd t h e t ex t o t e t h a t no t ex es no t t h d) t h e do cu m ex de t no ist t h o u e t ( a t g o . Th ex t o m t a ny g t h h u ea ch el ) , sing o f e m essa g o d o f so y a e, o r do e it s v a l u e r eco r d ( deno t ed b f i eld a n em e o f r ns a l l h a v e. An ex y nl y e v a l u no t e il d l d o no de r et u o u t h it s ch o u en a ppend t h et h l ev ( a g a in e ch il dr en sh e a nd t h de a nd r et r iev in t h ent en st ep t h r o u a s y t h e f iel d na m it h in t h a t e f iel d do o in a r e a ppended dir ect l y ex e a ct u ent essa g ich o u w t h r ned f r o et h e m w y e m el em e ame m N ct ing nt a ined t h r et u e t o s p t r y a u m l l , v a a o s a t h e t o cept io pt y n st r ing a pping ) . eeping in m F pa r a m w h t h r n c i s t s i r e s g o v e o it h ne t h u lat y o eQ M u m t h e m co nf ig u de in L -6 e : l a r s t r i n g i f f e r e a e n f l a n a f o n c m g r e h s a l i s t , r a e e t y , t h e s e t t o k o n e u t t d E m v o p e s y, e a l u t h e n a s t t l u e t h u a v v l d m t y g s a f i e o n t a a y s t a i t s o t h n , s t r i n n y e e t y l d e e l u p u y a m o t w v c e w n b p n i t a ppr o a ch , t h essa g lat An e co e t em r a t io n eQ ist ing I nitia B- 6 m o t s u i s b c e . n a e s s t i t u e c v o u e t f l a d f o m p t h e da t a b a se a ccess is co a x l u e i s t g r r e l i s t v e a e e a o t e w ( t h e n k y t r y h o h I f e t d g w a t i n h g e n . I ni ti al i z ati co n st r ct o r TM ai lTemp Q u ery S Q L : st r n g i n i n h e i t e d F F i eld F D at e q ) pl a t e X M det a il s C reat e; s : = TS t ase : = TD at o f m t h a na g e ed cl a ss it L do cu ex t r a ct s inst a nces o f m es, e to r y a nd datab e lat eQ u ery g st . C . C as x tr a e reat ri n ab L i ase. C reat reat t h e TD BD at E and i l) op ; en s: h t h cr ea t ed e q u a l ia s ase a ab ef o r e o pening ting its f ie e(Prop e; e(n c nt a ined g er y e a nd t o b e ent ) . a b t h r o u is r a t io n pr o per t ies a nd t h ; g a nd inst a nce e pa ssed- in v a l u u connect i , ery ) . l iz ing th on— t h a l l u nf ig u t h en cr ea t es int er na l { ab i s it a r e init ia l iz ed f r o r h l d l d cl a ss. t o e t h Listing B e s t h f i e f i e lTemp ery t ed ( f r o u T du ai pa ssing et er s. I t e co d a i s e e t y h . d e m nit , r o m ich p e t e n t h t h t h a n a n m e t h d e i n e i z g e h t l y n n n w c a o i s s i n t r i e w o lTemp ecu t u r e t o r e init ia l iz ed b ex x d ccess w ai d e i s u e i s I n k TM o s e ase A it h s e t h r e y o e a e l l y t p r l u c c a p f o v l l a l e o e e i a p t i c T l u t h c a t ) . a e t o t o s e b ex . I P O atab t er se do o ccu T d ] ssi alu nst r u ent s, b n c eld t co el em t h I ex no lEx l o ca t e el em D ; f es[ ; n Y esu d od ai i R n i se { F or N EM ai F i r V ld q TS l d uer y t n v ri a l u } g s; e s. a nd nd a t h e q u TQ l o u er y g o ery n , ( see Appendix e F D at ab i t h b e g i A li asN D at ab aseN L og i Promp i f Prop n alse; Q u Params. A d s. V alu Params. A d d : = u ery d o Prop i f C on n ec ery t h b e g i D at ab S Q L . A f t erS A c t i d ; t i F d ed : = u ery Q TQ aseN es[ (' p Q u ery assw Tru serProp ] U ame=' + Passw ord u ery A li < ' ' > Prop asProp =' + t h e a il - O u 5 t s 1 ] ; n s. V alu es[ Prop ] < ' V alu ord Prop s. at aseN > Q u ' es[ Q ery t h e u ery U serProp ] ) ; n Passw ord Prop ] ) ; . e; C reat e(n ab i ; l) = F D at = Q u ery S Q L ; roll : = Q u ery A f t erS : = Tru e n d ; S et o ce d u r I n d ex : g i n w i t h F f o up th ame e l i s t of ai lTemp I n eg er; Q u ery d o I n d ex : = F i eld s[ I n d ex I f s tr i ng v i n th i eld s. V i eld s. V F i r f t F ase. D i el ds and ery . lat eQ u t F i eld C . D i lay 0 c ab ame; roll; e; f TM e o ] al ues f t } u ery A erS ou n t – 1 Tex t = ' ty th en t } d c roll(D at aS ' t h e s emp t, s o r ep l alu es[ F i eld s[ I n d ex ] . F i eld N ame] : = alu es[ F i eld s[ I n d ex ] . F i eld N ame] : = I ex . D i lay i s ace i : TD at aS et ) ; n i l et o ue e al sp v Q entr y does n' t ap Emp t p ear y lse F eld s[ n d ] sp Tex t ; ; d EO pr o per t y F t es: t h e pr o u pr o per t y t h t o e N ex t o r o u t ine, To t h enev e int o f iel ds w t h it h nce y sing W a n S r a p h in a g en h t h m t h it t h e V h a s r ea ch e q u e l ist , ( see t h r eco r d ch a ng g ea ch f iel d r et u st r ing ent io v a l u u y r ned b se b o u t h r o u ea ch e y t h o f w y h end, t h e q u essa g a n ev er y t h e f o a nd t h e st r ing l l o w e Fi e su b eld st it u h a ndl er ) . Th f o r cessing t h es a r e h e s el d t io n t h e y t o is h a ndl er o u r pu is r eq u is r po ses. a nd pl a ce it s na m pr o ing r n, l ist . ent B- 6 is idea l specia l h e f iel d v a l u ist ing ich g r eco r d in t u e m t h a t t a ch de in L es, ned ea r l ier , h ed t h per t y e co r r ent h da t a g r eco r d. Th f o r es pr o t h er y r r ent l ist alu es int o l t ing st ep t h r o u e cu st r ing t h e r esu d t o e cu e l ist . As m pt y w it h o e a nd ir ed f o r es. e Post o u a se, o f et h es f r o a t ent t h m ine e v a l u e f iel d v a l u er em rop I t in th da t a b ec e f o r m ca n cy cl e t h r o u v a l u h a v y e co o u M nst r u ct ed t h a r e r ea dy TP a int er f a ce f o r t h ord R det er m roll ev c ca l l ed w o u int er a ct s w t a s a ccessed t h r o u pl a ce t h erS g r a m a ccess t h in a n a sso cia t iv o f ery sern Q : a t t r ib u u e Th er ea f t er , O l ect r o nic M ; : c v F D (' es[ ' t Tex F Y a ss E n e f t F { A u = i n alu lO ai es[ w e V M : ; b s. ' alu u ar Prop = t d v = : V Q r : ame s. n p o ame F { d M n e n e ase w B: ser v TN t h M S er M e r est is a ppr o a ch t o t o po st co TP o f is t h a t e m t h y a il send it m t h e pr o o u e m po m o e a nd m m a k er g ed in t h e u se o f e f iel ds f r o m t h o pen st a nda r ds b e y a il . nent g r a m co u essa g f f . Ag a in, l d co in ( a m a no t h er o b Façade desig e b a ck l a t er j ect t o pr o v n pa t t er n) . O a nd r epl a ce t h ide a sim pl e ne a dv a nt a g e u nder l y ing e 5 2 Appendices m a il do N O A im T s f a ent a t io e o s i n n t i o n e - m r i t e c e t h Th e en m e po r t d N t h po M w -7 : al i z ati r u ct o r TM b g i n i n h e r i e d F S en d er w i t h b e g i H ost t r e x ce d p b e n : t e n U serI g d C on d ; n end o ce F romEmai g i n w i t h b e g i F romA t S d e pr o g r a m . Al l y o u m u st f r e t . i s n TM o t o r e D t ai t h e I n a v e a l p i l a a nd t h l a i b lTemp l e o f e u e , t h y e o T u N c a eS ex en d nf ig u S M u T c P s e ( f r o er r a t io o t h m p e T o S n M a cco u nt m t h e M e T n t w c P o i t h m y p o o n u e r n ai lTemp po n it s cr ea t io n pr o per t ies u t r a ct s t h e o ser M n t . co it c 3 lat e l ist is l ist p h nes it t o u se) r eq u ir es ( t h lat e na m a nd init ia l iz es t h e- n e a nd e S M TP ith th e S M T P c o m p o ne nt. lTemp M er d o lat TP. C eS en d reat e(n es[ ai er. C reat e(Prop i ; ost Prop ] alu es[ ai l) s: TS t ri Prop ] ) n g s) ; Prop s. V alu = S t rToI { I g nor = Prop M lH ; n t (Prop e s. V M lPort ; } e- mai TM ai V l alu es[ M ai er. lU serProp ] ; } lTemp l, S s. ; e lat eS en d l, S b ec t d o ToEmai en d d er. ress d d S u b j ec B od y . ; d ToA n d S en d ; Post d ress. u j e S en , M M essag er. e b essa g Tex : = F : = ToEmai l; : = S u t : = M essag S t en d M t h e o d ( essag e: st r i n ) g ; ea ch b j ec nl y l; ; e; int er a ct io e S en n w m d e r ecipient ’ s e- m it h et h a il o e m a il er is t o d ( a l so t h in L ist ing a ddr esses, a l o ng et er s. Th ese a r e pa r cel ed u w r eq u est B- 7 it h t h ) e su p a nd sent t h a t t a k b o u a co es t h j ect m pl et ed e sender ’ s a nd b o dy o f t . Testing e o r u t est ing a s it n w h a t n. Th is l o e r ecipient s o f e, romEmai l; e a s pa r a m eep a n ey essa g ai e sent . Th and o r t t Tex e a nd t h k l n ing w e; r F F F m t h n e e m c S an u f il e f o r t h o f . M : ec ; ing To e r est ; essa g t h e em TN : p n na m e e r o m reat = Th er ea f t er , m t h y d e a f f ect ing n e r t } ai C d f e n h o st , on = en n ) . F r f a ti { o u int er f a ce. , o j ect , I nte st S o t h ni : p P it h n t r e m TP I n it h is pa ssed t h co e T B- 7 nent f o o o b Port og M nit ) , e S F c S { e n w ist ing e i l M ist ing Listing B L b a a il ing o f m e T er u d ( see L co e ex E m v S pl em is r et a in t h w t h e co m is h a ppening g co nt a ins t h pl et ed m pu r po ses, o u l d h a v t h e b e essa g l o g w it h in y e pa r a m o u r a ppl ica t io n, et er s pa ssed t o t h g ener a t e a e pr o g r a m l o g a nd es. f il e a l so ca pt u een sent . Th is a ppr o a ch r es t h a l l o e w ent ir e s y o u t o t ex v t o f er if y t h e t h a t Appendix t h e m er g f l a g e pr o in t h To f u co nct io TM ai t im cess is w e co nf ig u nt inu na l it y est a m so j ect is pa t t er n, O p co n st v ar b e r F i len g i n i n h F i len e ssi R ew d ; C l { o st r n C : = F t e(F i L os e th st r ct o r b e g i n C loseF i le(F i n t e d ; e n { i Write e eg i i og ai og an c tio d; { eF e w in t h it h y o u m is u t o pl ex f u Write eg i a l i eL og leEx . C reat e; F t t rac t N ow (Ex og em ex a m riteln(F lu s h (F F len ame) ; eL og D roy message } le, ; f e i l i i ns b eh en d; { Write LogF a le) F i ) leN ame(ParamS L Ex + og t ) eg i . est ; ; Exception); age); } s age: t ri n g ); t ri n g ); s ile, TimeS tamp + Mes s age); message } TMailTemplateLog.LogTes ToEmail, S u b j ect, t( Mes s age: s n W riteln(F LogF ile, Tes W riteln(F LogF ile, LogF W riteln(F LogF ile, LogTo W riteln(F LogF ile, LogS b j ect + S b j ect); W riteln(F LogF ile, LogMes s age + Mes s age); ou } { F E nsu lu en d; { R s h re (F it gets LogF ile); c e u w tO nly u time + F + romEmail); ToEmail); ritten rrent ); rom t etu rn th f un ct i on TMailTemplateLog.TimeS b eg i u lt := u } tamp: s t ri n g ; n es d; F t ; m ormatD ateTime(TimeF ormat, N ow ); m essa g t t h lat n w h t h e r g o eL en t h e. A de. g g ing . Th e og en it e t h 3 cr ea t es r es t h a t pu sim h m e l o a t ica l l y t o r(0 r pu lTemp o f ind a o u o u cl o sed w ile); romEmail, y er ; testing procedure y e ensu b } lat message LogF t o pl e n F , ai a u a t ica l l y nct io F , i og roy s M t a r e in t est e a ppl ica t io r em er o u o u 5 t s ) ) , a is it sel f pr ev e o e w Façade io u l d l o s g r a pper desig pl if ied int er f a ce. ns. TMailTemplateLog.Log(Mes W R ) e f il ena m st m a no t h t h y g r a m nit , B- 8 e o f no t e pr o ist ing e na m ormat F error procedure en o r sepa r a t e u L f il e is a u m er t h TMailTemplateLog.Error(Error: Log(Error.Mes b a l a r iz ing h cl a ss et h n en b g le) F est r lat lTemp L D d procedure b og l t im ef o r e sending h u } me(L F TM n t h o r e co u ines w a il - O ; an L og pect ed b in a g l ect r o nic M e; h le(F e r e g eTi d e C at n i l reat d D i o ame: g h gging y a ss E ( see r r ent m M du j ect a sed o er a l lTemp e o j ect Th is f ri u ed. ai t m e) . Th e l o g y TM ame o f n o b e cu og i l w r ormat A n e ct r F e th u a s ex r it t en ( a l t h o u sev Lo o a l o b t h er w e st a g : g f il e b dest r o -8 en g v h iding Listing B { m o r og ding g s a r e no t o b eL ped l o f il es a t o u ing n f il e det er m it s o lat cr ea t ed. I ncl u l o e y int o lTemp o r k r a t io B: n 5 4 Appendices o u t h a nd E Y r co nv m o m en h a v r enience m de. F et h t o e t h r ee m et h . Log a dds a or et h ina lly , o ds f lu sh see a ll t h o E d t h a t r t h o r ds f o r sim int er a ct ing ple t im est a m r eco r ds a ll t h r eco r ds a ny or e f ile b e r elev a nt u lo f f er g m b it h t h cept io ey e lo essa g e det a ils f o r ex ef o r e t h essa g w ped m a m ns t h a t co m g e t o plet e, f ile: t h Log, LogT e f ile. LogT essa g e sent w h e s e t it . All t h ensu y o u t h a t , t ile in t est a r e pa ssed t o r ing s is a ese a r e a b le es. All Together Now N o w w t h a t it h co h m y o u inim er ent h a v e a w h o e . d w it h t h p u r e { nit $ A Listing B-9 v a o b et w j ect s, ea ch een t h em per f o r m , y o u ing ca n pu it s o ll t h w n specia liz ed t a sk em a ll t o g et h er T P h T e Y P c E o u ist ing m C p O N l e te ser B- 9 S d O int er f a ce, ) , a nd is m dir ect iv LE } a il -o m u t p r o so a ll o f a r k t h ed a s b e m eing a in co a co F romEmail, Q u C ou ery S Q ToEmail, L, nt: I EmailF c e. e ssing. u ery S end S u ield b j ect, s t ri : Mes s age: s g ; alu es rop] ; t ri n ; n g s age; TMailTemplateLog; Template: Q : TMailTemplateMes TMailTemplateQ u ery ; TMailTemplateS end er; t.C reate; er: egin P rops := TS tringLis := n i l ; Template := n i l ; Q u := n i l ; S end := n i l ; C ou := 0 ; t ry th e LogF ile ery er t nt ry { L oad Load { MailP C ile { en p p rogram p rop erties roperties (P rops and th e reate LogF O op en := th e l og f il M L temp l ate d oc e u } reate; ment } := TMailTemplateMes s age.C E p arameters x } ); TMailTemplateLog.C X Template { trac t v ariou s .V romEmail := P alu es [ u ery := Template.N od eV alu e(Q u ery S u b := Template.N od eV alu e(S u b := Template.A ttrib Q L ect EmailF { Q Q u u ield ery th e ery d { i C := reate f n end er L og p ase interf ting := t ac h e to arameters LogF ile.Log(LogTemplate LogF ile.Log(LogS u LogF ile.Log(LogD atab LogF ile.Log(LogQ u ess eac l e n Q eg i n b roc tarted i ot u rop] romP teV alu j ectTag); e(Q u ery Tag, EmailA ttr); ery e .C reate(P e-mail sy rops stem , u L); Q ery S Q } end er.C reate(P rops ); ); rom b + j ); Tag); } ile.Log(LogF P TemplateP en ile.Log(S h u u th TMailTemplateS LogF w [ } LogF { MailF TMailTemplateQ an Tes ot S { atab .V rops } Q S rops reate(P F j a de a ppea r s in nteger; ile: int o nso le a pplica t io r LogF B f n h a s no ( see L P : o ns b le. Th e a pplica t io t h set a l int er a ct io F romEmail); + ect as ery h rec ord .EO F rops u b + P rops u ery S e + ery P + f Q do rom j .V alu es [ TemplateP es [ Q rop] ); S ect); th Q .V alu L); e q u ery } u ery A lias P rop] ); n Appendix { th e rec ToEmail G := Q th { et P erf orm d X M L Mes s age { nd ou Tes ting i A f logF oc el b s eg i au nt); .N extR d; n l atc l h any alu resu es [ EmailF iel d s ield ] ; - ery f eMes ts s } age(Q u ery .F ield S b s ); } t(F romEmail, ToEmail, u j ect, ect, Mes Mes s age) (F romEmail, ToEmail, ormat(EmailS as not to ov ent, erw h S [ el u b j ToEmail] m th em } e s age); )); e-mail serv er } eTime); ecord ; Exception errors and do rep ort th ile.Error(Error); ile.Log(F id rops y u p .F ree; Q u ile.F ery S end .F ormat(F inis h ed , [ C ou nt] )); } ree; ree; ree; er.F ree; d; d. Ch eck ener a t ing f o r a ny ese ca n b inst ea d o w it h t h f t h e t h . e Loa list is v a lu es. e t h op M a t i t o i o T e a s s F e m p l L o a d t h . E x w . M t h t h a il m S er g a il o u ea ch leng t h m t , er y nf ig u g h t o o t h er t X co o r essa g is co w m g o b t w u a T M ecu b it h a t h t o d co a n f o r j ect a i t h . x M a i l P t h em t o op e s: r t i e e pr o g r a m lo o k s f o r t ensio n. F ex l e X M a LC ex st r ing on f t r a ct o u r n f ile t o r r ent a s r ea d o m list g u i t h eir cu r o , s r a t io m r eco r d y r w nf ig u ed int o m e is r et r iev l T t ed f r o et er s, ne t h u e sing nit . Th is necessa r y sessio n a nd e m m t o l t h a e r eco r ds r et u p T a t e e t em M a i m e ge s s a t h e co o b nf ig u T m e m t h p l a e q u t e Q u e er y , r a t io n j ect . pla t e f ile a nd pa ss it , l r ned f r o ed f r o M r o b y per f o r m a lo ng j ect . ing t h e o . t o essa g t h e lo e is sent . Th is w r a b o f t ine f r o j ect s Log o e e ex plet ed m r it e it nf ig u u L r o M n pa r a m a ll t h e f ile is specif ied, b es a r e a s f o llo it . b r a t io essa g et er s in Loa e na m pla t e f ile. I t s na m e a s y o u end ea ch m t em e q u e co I t er a t e t h r o u m L om et er s a nd is pa ssed t o t r a ct it h e X a il m pr o per t ies a r e r et r iev r a no it self g r a m e t h l ne. I f e e pr o r e e- m pa ss in t h lt na m e t h a nd- line pa r a m r it e init ia l set t ing s t o pa r a m . r T m e def a u sa m P m sed t o pa ssed Cr ea t e a w . d a nd sending co e u select ed f ile, 6 5 y T t h 5 5 t s en Error: on C en . 4 e u d; Th e st eps in g 3 s ou ery Template.F 2 h so au u LogF 1 se Q LogF en u l th a il- O d; LogF en q t end nc(C { P .V ars t I cept { ith ile.Log(F leep(P en a s merge Template.P u er.S P S i tp w lect r o nic M } ield mail ment := a ss E n end { f e .F ile.LogTes LogF en ient ery M e S ex u ip u B: le t h r o u e t o g a it g h a T f ile if r edu t h M o a nly ces t h i l T e m p l a t e S t est ing . A pa u e lo a d o e pr o per t ies f ile. n t h e m e n d e r o b se is t a k a il ser v er , j ect t o en a f t er a nd it s 5 6 Appendices 7 . F ina liz e t h co m e lo g plet e. To da t a b f ile ent r ies a nd f r ee u r u n t h a se a lia s w e ex it h t h a m ple pr o e BD E t o po p a ll t h j ect , int y t o o u t h e o b j ect s. Y need t o e su set pplied cu u o u r p t h st o m m a il- o u e m er a i t a b l t t is e m p le. NOTE T h p e c r o b c o d D a s t a Y p n d a o u r m U ent o no lo g du w s , t h t h e e n a o e n r s a b u e t p i n g r a a n a p n t r m a i t h r o t h f o a p i d g t h w l g f i n i n e a s c n a s it u y it s em ses t h n d e a a a r s e t h e h a e v e f i n t h a l .dpr c n d f i l e .dpr s d t h s , e t h m t h e n s , e a n d. i n t t h e g ener a t ing b i r t a e o n r e e o u t a a l l d g t o i t h d o e e o g s t t y i n . a t h p o a l l i z u f t e e i c i t i a Y o i n i n r e t o i n m w o m o h o c a c g n i n I n s i t l t h u m a n e r e t h e t . t o o u b ld inclu ca u p P y p o p l l e o c nt a ct s ( b it h st a nds f o r nly r w it h da t a b edded q u de a n a e na m t t h er y , t eir per m a se a nd ser v a c h a nd a w m ed f ile( s) e n t o b issio er y elem t o co u a t io n, u g ent o u a ss m n o f sit u a y e sent m w it h r se) . J u t h o . E in t h t a iling s f r o st m a lt er en cr ea t e t h nh a ncem e t em ea ch pla t e X m e ent s t o essa g M L e. Th e . y ch a ng S les/ o b j ect s, t o e r em o u m im g r a m ila r ly , ea ch o f m w h o ich o u r w ding a ny t h a pa r t s o f co it h ning h a s dif y y o r k s w pa r t it io w o r e ea sily pr o t ect S e inv Q L est m da t a b a pplica t io ell- def ined t h e pr o g r a m s cu m a nd w it h m ent f r o m f u a se a nd w n int o sim ple inim t u r e it h a ny sev er a l int er f a ce, a l ef f ect s o n a inder . t s. I t r et r iev m e o u D e t o u t det a ils pr o g r a m m nf ig u a t e u h ed h r a t io da t a b a se u int o t h n descr ib es co a e f o r m essa g ese elps t o es. Th is pr o er . s y essa g t h e w n f ile f o r y o u ser v r eco r ds f r o m t w o f f i c i e Th e a pplica t io m e d t e a A b s u co n . i n o pen st a nda r ds h TP a llo o u t i o d ry M t h a a o i t , r co u p t o n l t e f r a t io t h a t l i c t h e a pplica t io pla t e w is u t ech m i s g r a m m sing S e a se o nf ig u e pr o a d p e W r e a da t a b a il t em m o u r c r se t h m r est c , o p m i n n d a f o ca n u e co do cu u r d s s m t i o d i s l a a r a a a t h c m g l i c t h t h S p r e r o t o o u y p r o t h i e f o r e f h e e u o l p f r e d d y e t h o e n inf o r m sing eld in a no t h t h e w se o f ca n b ech a nics, e o r ld u X M L ea sily a nd w er e per f o r m it h S Q L er a t io n f r o , X m M er g L sing a S f o r t h e co M TP o u ir ing r eq u cu m ser v nf ig u w it h m iz ed elect r o nic m a n X es f ields f r o do a lt er ed t st o o u a ent , M L m do cu t h ent , a il- select s ese r eco r ds int o a nd sends t h e co m a plet ed er . r a t io n f ile a nd m t m a ss m a n r eco m in- dept h pila t io n. k essa g no w e t em ledg e pla t e, o f t h e Appendix C A Customized Client S ince a ll X sim ple M Applica t io sea r ch g L t r ee do cu st r u se t h g h t h e t r ee st r u pr esent ed in so client ( t h pr o o se b g r a m ser v X M m ing L o u o u illu w t h e r u ea sy e t r ee, f o r cr ea t e new a lw X a y s t h M L f o r m er ne D w TD a t . H ) . X ing t h o r w L w a no t h m in g 2 a sed o la r n t h o u la r a pplica t io n t h a t k o w , o r ev er , a y b e b et t er a cu st o m iz ed m ent t y pe n- independent w a lso TD H do cu v ides a n a pplica t io int er o per a t e e a a nner . a r e f o r ced t o m need f o r pa r t icu m e D f ields. ser - f r iendly . Y ea sily a nd h a v ener ic er ea s r ela t ed da t a h a ndle a t o a ent s b pa r t icu er e is o f t en a t o er cu em in u h st ill pr o client it h o st ence t h M e e m es ed in Ch a pt er t h do v a lu def ines, ned specif ica lly a llo pr o cess specif ic e o t h n o les descr ib t o desig st r a t e h o du e elem li en o u t es, t o v pr o j ect s, u w o lo a d a nd pr o cess a n X ie- w g r a m a nd t h ent s in t h a pplica t io it h no a w da t a b a se s a b o u t t h is h ich er f o r m a t t h a t r ea ds t h en pr esent s a is do cu w a t ch m ent f o r m t h M e do cu U I t o b a sis o f t h do cu ed pr ev m ent , r o a r e r ela t ed t o e b L descr ib w ent o t r a nsf o r m o t h er ig a t io n t h sly . W se t h r o u ea ch e na v m io u g D s it h t h g h o u pr o do . R I m o u a in- eca ll t h a t a nd I D v side, elph i y int o em t h r o u n y e client it h D R E ide w it h in t h m e F e n. t r do cu e m ce a t y pe a t t r ib Y t h da t a e da t a , se t h specif ic o b The C e ns a r e no t m de, p t h ca n u ca n pr o t h is t y pe. To y it ct u r e t h a t , a sed o t r a nsf er ent s f o llo r e, ns ca n displa y t h r o u ener ic a pplica t io u m ct u client m ent a pplica t io Th e m a in f o r m inf o r m a t io e f o r m ( see F S eco nda r y su ch a s o n t h scr eening h M e a pplica t io t h e P r a m nt r o l pr o na v S t do m r es C- 1 is w m ent list , a s o a y a y g f u nct io e e m C- 3 m t h o v e u det a ils e m f r o ies, cinem ser a nd let s t h a in a ccess t o a s, t h X M L a nd scr eening s. em ea ch o f ed o n t h ing o t h b r o w se t h e e t h r ee list s. e r ig h t side o f ) . v ided b n t h o u r elev a nt it s det a ils a r e displa y h o y v do u ie pa g ca n ea sily b le- click e, f ind a o r o m o n t h v ie, e m n link o v select ing ie na m a f ields, e o sessio n t h n, e a nd is. t o lo a d is specif ied a s a n ( t h is is necessa r y r t h e det a ils t o ides t h n is pr o cinem e cinem cu a a ll t h r ee list s: v t h r o u ig a t io o f e. I n t h L t h a co ig u er e t h Th e X t r a ct s int o en displa y s t h e list pa g w ex em is select ed f r o t h t t h n. A t a b As a n it em f ind o u n a nd pla ces t h f o r n: 5 7 la t er o n) . To co m m a nd- line pa r a m a ccess t h e f ile’ s na m et er e, t o u se 5 8 Appendices Load F F igu r e igu r e C C -1: -2 : S F e D l e ind ocu c ment(P a t a c tim u e r r e w h aramS tr(1 nt m v e o ie ), F Mov . n it is sh o w ing. ies , F C inemas , F S creenings ); Appendix F igu r e C -3 : S e Y e w o u m t h r o u t h h g e a t th a k e u h o u t o b e c se o t h em a r e t o r eq u a t t r ib u m t h h na m a ch co ilit y list t o r et u w it h h a v e im m u f u st o m 5 iz ed Client a sso cia t e a n o b r ned f r o e st r ing nding t h e o b O b j t h e t h e, c t w a dds a it h 9 b o x t o o t h ea ch n t h e e u e f o r m en, st r ing r e co nt a ins r ef er ence t o pr o per t y . As t h s r ef er ences. Th a ccess j ect e lo a d pr o cedu a nd e list j ect edia t e m v a lu nt ent s int o ng A Cu r . e a s t h eir a lo o u f f e e co r r espo t h ) o list ’ s a b . E in t h a t ica lly y s to e st r ing co py est ed, a g r a m j ect list s, a u a displa y a ppr o pr ia t e o b t h f m e pr o j ect ’ s dif f er ent ine C: w h ser ( w h en m necessa r y o b a n select s ich so r t s o r e det a ils j ect a nd it s t es. TI P S t r i n j u o s t r d d u o p I n f orm a e r t i c a u g l a r insu ex o t h o er v iding l u o b ie o b o n v a a i d W m n , t h l u e o t h b j e j ect in L D S t h e e e l p r , b j D e e u t i e c l l y r o p r a S a V i a g e c e p r o t h i h s p g pl T s p c h t t i n l i s t s . e O t o e a u u s e r t y e m i n p r o p p r o s f u l e g d p e s l e m rt l e h y T p e e n o a d a d m a c o a n m u o t o e h u i t h t e h a t h y w c e l s g i a u ru t r o w l i n o T n l l o e s s o t o c r t y u y r t y t o e o h e r t y p w t s . r o a t o o n n t i c d l i n a p j e c t a a w n l l y g o f r o f i l e i b t h a m .i y r e m f m s t y l e i t h a . g int er f a ce f r o , s X w h M ich L pr o per t ies f o r j ect s r a t h er i n s . d t h e ser O l g s e r t e i n e u M U s o l l y H s e s t r i n t s . t o a g nit , f i n e f i n f r o r y s la t e t h t r a ct ed pr o v t e e s t r i n sepa r a t e u m a ti on To n l u d e l i s t o a v n v a c v A r e e e t e s . a g t h a s t r i n l u a n r s l i c e a l i s t s a e p n v g m . H su b C- 1 w t h e so u r ce X M L do cu m ent , e cla sses co r r espo nding er e f la t t en M - elem t h a n indir ect ist ing m def ines t h it h t h y o u o u t ent s a nd a t t r ib o nes t h r o u e X M L st r u g h ct u t h I u e X D t es, L int r o t o t h t r ee a nd dir ect w n in L ce a st r u j ect s ct u r e, po int er s t o r ef er ences. Co r e sh o du e o b ist ing m pa r e t h 2 - 1 . e 6 0 Appendices Listing C { D -1: etail s A m ou t a s s (TO ri n g ; s ri TMov ie pri v a t F I d : F N ame: F R ating: F Length F D irector: F S tars F S y f un s t t b j e mov b j c t. ie } ect) i g ieR ating; ateTime; s TS t ri ; n g tringLis is i ; n TD : ct : G s t ri etR on S t; ; n g atingText: etR s t ri atingText(R ; n g atingText: s t ri ; ); n g N ame; c con s t des t ruct ruct C or D reate(I es or ; t g d y I d y N ame: propert y R ating: propert y R atingText: t S e etR s ri n s ri t : s ov propert ri : troy propert w en o a TMov : nops l ie e procedure pub v cl = ab o t rea n ri F I rea TMov s d w F d ieR g de; d g ); n erri ri N ating t ri n t g I d t e F R ating w rea rea F ri e ame d G etR d F w ri F R ating; t e F Length atingText atingText; propert y Length propert y D irector: : TD propert y S tars propert y S y : nops TS is ateTime s t ri n g tringLis : s t ri n rea rea t g Length D irector F rea rea F d d F S y nops d F d S w tars ri w t w ri is e ri w t t D S tars F S F e ri F e t e ; irector; y ; nops is ; d; Alt h o u g h y o u necessa r y t h u t u t o er m r e, X M o r e, L y e t h r self , it h o u h a v ing t h ser m t h is h m t h a t io la y a no t h er M L m a k o u it h r ce o r it no t m u h a v ilia r y o u co m e o t h in so a nd ex ch t r a ct k no w ld, er a t w f o r a b sed t o so m a y o u t h e t h e pr o per t ies. e t im w t e r epr esent pa t t er ns o f u a ll t h ea sier e t o j ect s a r e u f a m ea ns t h a t so u es do int er na l o b j ect s w er t r ee it self m n. Y h a t o r ld o b t r a e X a ppr o a ch ent s a nd w is ex f r o g e inf o r m e r ea l- w t h e da t a e u ig a t e t h r o u do cu h a v lo a d t h ch a ng y o u dea l w . I nst ea d, r t h f u n t o ct u r e o f em F ld na v det a ils a pplica t io st r u co u it h e in t h o u t h a v e ing int er f a ce. NOTE T h p i s r o o g b a n o n j e c o t h e i m h i d i n r a m m t o r l a T c f o r y o u r et u r ning To t o m P a rs d i n g D . J u a u o co nt ent im plem h a ndler t h d v n n u t a t i o n s e nc i r e e f o r s e r c d t h e p b f a e c t a i l s i s su l a tio y t h l y e pr o t d a d l ing o a e o b p l i n o e c g e o B y m n o f t h y r , t s a g n n. t h j e c t i n u cedu n o f f e o o k e m d u a t h e r e u s r a a c r e e d c e a t h e y s i e U o k e r s i n s e t h a . s t a g u i t r e i n i n o o i r m i n j e l e k c d l i a a t e b w r e t o g f n n c c c e r i e e o e e r f a t - o g s o h t e o n a i s n f o n g a e n d n e n e s o i n t h e r . r e decla r ed in t h e na m ese m em e o f t h e X a t ch er o b M L is u do cu nit m h a ndles a ll t h ent e t r a nsla t io a nd t h r ee list s t o u n se in . U o v ie- w sing a S AX - co j ect s, m plia nt en ts pa r se t h e so u pa r ser m r ce X a k es M L t h is do a n cu m ea sy ent a nd le t a sk . a lly M t h L ent ing t h D oc e ca se in u h a ndler t o p a e q u e cr ea t e t h su r e o t m a pa ss it g the X As is u u n n e da t a . ener a t e a int a ina b e w c t o u st t h e y m o l e d oc l e n d i t h w p k i s w t i m , o h e n Th e Loa f g m r . r t a o i n o e p p g t h a t t h e S e I AX C k no S s a b t m m sing w on - co u e n t o u H plia nt AX a t f o r n t h d l e ex e r pa r ser X M L pr o cessing , pect ed do cu int er f a ce. P a nd su pply m ent a ssing ing a y o u f o r m need t o a t , w h ich w r it e a m a n inst a nce o do cu m ent f ea ns t h e ident if ier Appendix ca u ses t h e pa r ser pa r t s o f t h e do Th e sim int er f a ce T D e f a u l t H a n d g ener a lly t o ea sily o t h e S w n in L AX def a u im lt do Listing C S A c : D a ct ly C ontentH pri v a F C inema: F C inemas F Mov ie: F Mov ies F P rice: F S creening: F S creenings F Text: pub l and i 6 iz ed Client e h a ndler cla ss t h a t t h su o u do y g b b e t h e S and o u m l o = er cl v th a e b w w All l a s it r ea ds t h e ir em p e r u s def a u g e m o h 1 e v a r io u o v v ef e r au d ent s im ent s a ll o f plem y S io r s f o r er er o b co t h e m et h o d a l, a llo w ing o nly o f t ines, c u e int er f a ce, m t u e o f nt h mov t h a ie-w w nd le h h a ich m a s f ew u o f sing t h e u b e m a r e a lr ea dy e do cu atc h a ndler , enef it r o t h e ea ch nt ent j ect s, AX ou and a t ch er f AX er r iding . e b S h a ndler Th see t h o ab ltH m . eh a v a t ch -w h cu b o u o t h s v ie- w ie tc b ie- w specif ic pr o cessing a nit ) e do pplied er e y ent s o now su lt o r k ent s t h t ines a r e decla r ed a s v ir t u it h . H t h plem h a ndler cla ss t h r o u e m at s H ener a t e t h (TD s X im lt pply ing ese r o u e dea lt y A su t h e r eq u it h def a u it h a se. r ing a h st def ined, ent . r . er d oc u ments } ler) inema; TLis TMov : t; ie; TLis TP s t; t rice; TS creening; : ri TLis t; g ; C reate; n s t t ruct ruct or D es or propert y C propert y Mov propert y S I C ; : ies ov : and procedure C procedure End h l erri TLis t TLis creenings ontentH erri troy inemas t : er de; rea F F inemas Mov d TLis C d rea t rea ies ; ; F S creenings ; A X S ov d } aracters (con s t ch Element(con s t u : S ri, tring); localN ame, q erri N de; ame: S A X S tring); S A X de; S tartElement(con procedure con atts s t : I A ttrib u u s tes t ); ri, localN erri de; ov ame, q N ame: S tring; d; As ca n b t h e cu co m e seen in t h st o m plia nt u m ( in t h is ca se t h ct s t h r ee list s, a nd f ills t h em w e n -3 L oad X w ith ref M : Mov Lo L d ies a d oc ing th u e ment m o and t h es to Load D ocu ment(U C inemas Lis t, v p erenc procedure I nd X MLR ex: ead H and ler: i H { a lo lt o nding e do m ng w ist ing it h t h C- 3 th ie a ess ap rop e R p I Lis -w roc : t, S s t tc h e r into e st r ing riate ri n g d I I X MLR TMW C ontentH ead M W C list s u j ect s it creenings C reate ler th := e X M L TMW C ontentH p ler; arser } and ler.C j Lis n and u m e nt. ec l ts ists } ; er; and c ob nteger; er: o string reate; t: TS ) , a n inst a nce o f a n inst a nce o f ne) . Th e T t o a in- specif ic o b r eg t ine ( see L e def a u co r r espo it h r o u t is cr ea t ed, ent . Listing C a oc pa r ser , { D h a ndler pr o g r a m m d nt ent nst r u do cu e Loa iz ed co cla ss co b m c { v a ler TC : des en l a o f in a . To sa t isf y c ent s in t h st o e con ov em h a t C- 2 ontent TMW t se ing . All t h w a s e e ev int er f a ces, int er f er e w -2 X u ent s need t o no t e t h cla ss ( in t h r no t h ent ed t o a nd do A e h a ndler plem { l ist ing ev k def ine a e r epla ce t h Th is is ex o t o a k h a ndler o u sh a y m AX inv A Cu ent . w t o t h a t y t o m plest is st a nda r d S cu C: tringLis t); on t e n t a H sed in t h ex a S n d AX l e r e client t r a ct s f r o m t h e 6 2 Appendices t ry X MLR ead er X MLR ead er.C { A nd X MLR w i t h b eg i p arse ead H and A re f th f or I f or f d; a l i f ment } u I ); h ere? X V end or.X MLR ead = ) er; nd and t o d d O t o t.A ou nt d d t h and b l h nv alid er' ies s .C .C l ou D - ect(TMov ie(Mov C inemas ou ies nt - 1 ame, C I 0 S creenings .C d d ormat(S t.A O b ex] j ).N ect(F creenings creening(S creenings [ C nd I ou nd ex] nt I I nd [ [ ou nd [ R I ); ert nd ex] ).N I - 1 to ou tp u t f ormat } ame, Mov ies [ I ); nd ex] [ I nd ex] creeningD es ie.N ame, inema.N ame] ).C ); do ).Mov ex] U onv inemas nt ex] + c do ect( o or do [ t 0 ment and 1 j O nt ocu ists nt .C ou en j Lis ef inemas ) 0 reate(I Mov creening(S ler.R = b := ler.F (C or inemas creenings and ) e 0 Lis ex TS y 0 .C t.A := creenings H } = th inema(C I l H 0 inemas S n := ex TS c, ), = ); 0 t h en ree; d; d; nce t h su e pa r se pr o cess h a s co pplied t h r o u M o g h b y t h a ll t h e es o tru c f t h e it em do cu m t h e co t h e S eir ti n Th e f ir st ent t a t in t h E l e m { C e int er na l m o reate : { s P ob j r e a v ev b e o b as essary nec ontentH and ri, localN ame, w w L oc ate th e mov ie un ct i on F ind Mov ie(I v a nd ex: I nteger; b eg u lt := n I ex := q f F Mov t j ect o r t h e i es f or nd i f TMov b eg i n i o r l d or d ie(F 0 t Mov o ies [ I t o o b oc S e A en giv ri g ): n ies nd o m del is per f o r m del inst a nce o f u j e b nes st ep b .C ex] c a ed b sing y e t h le u t h a t t h e m is no t if ied t h r o u env ir o nm co r r espo em o st ent f o r e se, nd t o a nd a dd it r ecent ly co el ements X S tring; id entif con ier ie; d nt = I 1 do d t h en s t o b } : I A ttrib t o t h nst r u u tes h j ect s eir ct ed } atts g la t er t. ment TMov ou ).I e. ine t h e a ccessed la t er . ; l o ent s t h n R m e h a ndler m elem r I e o o u a n a ppr o pr ia t e v a lu ile scr eening s co e cla ss is int ended f o r t h em ame: th s l -w t o y tartElement( N ith : o b ef er ences t o f o r a ler.S d er new ) . R r e h t h list s, list s. t ines. F j ect ne f a t ch ince t h cr ea t e a C- 4 int er na l ts ie- w o u r o u e a . nt er ed a nd t h ist ing in t h w pr epa r e y t h st r ing d, r ing a ts v ing es ent er ed, j ec o o f is enco u ent del, ese list s a r e t r a nsf er r ed t o ea ch ie a nd cinem ct o r . S o t h o r e ident if y na m e m ent C u t p ec TMW procedure ( see L it h t h F e necessa r y et h er eld w o t h . eir nst r u m t e o t h -4 con ilding n plet ed, el O elem e in t h j ect s a r e h e t h cr ea t es t h a ppr o pr ia t e list Listing C u a s ea ch r pr o cessing it h od h a ndler ’ s co ct o r m g r a m s a nd set a sso cia t ed m st ep in b nst r u pr o a s h a v g M Th en, o b ca lling v ies a nd cinem na m w ler; R nt gh Lis nd [ s A and oc l ou rou ex ies I S on etS H Exception.C th nd or en al .C e s tep TC C ey ies i S C O G := do creenings Mov en d e(U (S ra { en e ler (Mov i i th er.pars := ler and n { f ontentH ); Appendix R es u lt := TMov ie(F Mov ies [ I C: nd A Cu ex] st o m 6 iz ed Client 3 ); Exit; en en d; { d; L oc ate th e c inema f un ct i on F ind C inema(I w v a nd ex: I nteger; b eg u lt := n I nd ex := inema(F C u TC ith th e d : C inemas s t giv ri en ): n g id TC entif ier } inema; r I i n R es f or i f TC b eg i ; i l 0 t F o inemas [ I .C nd ou ex] nt ).I - 1 d = I nd do I d t h en R n es lt := inema(F C inemas [ ex] ); Exit; en en d; { d; L oc ate th e p ric f un ct i on F ind P rice(P ing v a nd ex, I nd b eg u lt I nd TC sc h eme riceI d w ith s t ri n .C ou nt : th e giv ): g en id TP rice; 1 do entif ier } r I i ex2 : := n ; ex := I nteger; t o n R es f or w i t h b eg i i l 0 inema(F F C C inemas inemas [ I nd ex] ) do n I nd ex2 i f I nd b eg i n R es P > lt := u := ex2 ricing.I - 1 t TP h nd exO f (P riceI d ); en rice(P ricing.O b j ects [ I nd ex2 ] ); Exit; en en en b d; d; d; eg i i f n q N b eg i n = Mov ie F Mov ie.R F Mov ies e f MW F en d el s b ame .A N d d i n F C inema := F C inemas .A d el s b e q i N f i n F P rice F C inema.P d el s b e F S creening F S el s e F P en d; M o cinem i q f u o b := TMov ie.C := atts .getV inema C = MW P N ame := F t h t h e(MW .getV R alu e(MW I d )); ating); en t h .getV alu e(MW I d )); en reate(atts d d O b j MW S := TS creening.C d creening .getV (F = d MW P S S e elem t h alu e(MW .getV alu I d )); e(MW I d ), F P rice); en reate(F alu e(MW C ind Mov inemaI ie(atts d ))); P riceI .getV alu e(MW Mov ieI d )), creening); es s ion rice(atts ent , inst a nces a r e co .getV ect(atts = ind alu reate(atts rices rice.C .A reate(atts inema); j ect s a r e cr ea t ed t es o f a C inema(atts rice v ie a t t r ib C creenings d en ie); (F ame n en h inema.C d TP i ind MW TC eg F t ricing.A N f = d := q i Mov ame eg en (F ame eg en ie atingText q i Mov b w t h en .getV alu it h eir ef o r e b nst r u t h eing e(MW I D d )); a nd r a t ing , a dded t o ct ed a nd a dded t o t h t h e list e cinem a s ex o f m t r a ct ed f r o o v a s list . P ies. S im r icing m t h e ila r ly , det a ils 6 4 Appendices b elo ng t o a a dded t o S g h I ef o r e r esu t o c u E j ect h a ndler inv o k st r u ent s eir t h r o u t es. Th t o t h ct u pr ice elem C i n e ese o b e m ) a ent s ca u o t h w se a new o v ie a nd cinem j ect s a r e lo ca t ed f r o scr eening a n a t t r ib u pr ice o b j ect t o b e n list . e m o b it s list . I ndiv r e v ia on ten a ppea r o g ed a s t h elem u is a dded t o g C elem so j ect ’ s idu co t h nst r u a l sessio t e. Th m a link eir it h g et h r espect iv ct o r . ns w ed t o As in a b e list s ef o r e, scr eening e a sso cia t ed pr ice o b j ect er t h e r ef er is lo ca t ed la t er . ti n j ect s in t h a , a ’ s ( F nt a in r ef er ences t o pa ssed pr icing er cinem cinem a t t r ib F ed f o r la t h o b R o b eir u O la r r r ent eing lt ing t h m D b a nd sa v Ac e cu cr eening s co t h r o u b pa r t icu t h w a s n r ig h t h e co e w pr o per t ies h t . Th eir C h nt ent ent s a r e dea lt t a r a c co t e r it h in t h e E f o llo n d t h E l ent . w e e H ing m m o del o b a ppea r s a s t ex ev s is pa r sed, o f nt ent e n o t h ev t w ev e S t t h a t er , a r ent , j ect s, t t h is t o r a t h er is r et u E l e m nce t h m e et h n eir o d . H t co t h a n r ned t o is o ence, nt ent a s t h e nly t h ese h a s b een ident if ied. W it h in t h t o a ny ex co nt ent t o em b t h e u b se o f A c c u mu l : eg i F en A co nt ent a de u c u m tex C ent p o f sev ch u t l a c ting te and o it w er a l t ex CD n in L f o r m t p ist ing la t er . I t no des, elem h ) , y o u in t h e s a dd t h le f o r per h a ps co ent ATA sect io C- 5 is po ssib m y ing n op f r o s e new t ex a n elem i m dif f er ent ) , s t ent ’ s o r t h r o u g h ns. x t. ontent ontentH ( sh e a s t h e e r ef er ences o r c TMW ev e a nd sa v ent s ( su ate procedure b e m ent it y -5 t v a lu edded elem Listing C { e t ex ist ing } ler.C h aracters (con s ch t : S A X S tring); n Text := F Text + ch ; d; TI P S o b b a v i n e h a o S m e a X v s i c p e M i o a r a L r n a n o C h ie- w a r a c p l f . e a m in t h w h e m ich o o b n u n ev t u m a l l e r n d E h ie, j ect o t i c a l l y t h r o u d s a elem del ent . O t h a t a ccu l e ich ent , v t o t r o r e m s ine w elem e l y er r Th e E n a o ed ea r lier , ca n t r a nsf er det er m c l l t h n o g e r m h t e a x a l i z p t r o i t e t e p e f i n d x t r t y . s , r e a s T h t h e q e p u y a i r i n r e a r s e g d r t h i t . u e s e h a I n o d n h d t h e l e e r s , r e r i s t o t h f a d i s i r l y o t h e erti es a t ch t r s e s i m rop v r s e b i t s e As descr ib m a n d t i o g P p c t h m e o b a , t h t int o t ine ( see L na m b L t h eing f o r co nst r u t h do cu eir m co ent t h a t nt ent b o se elem e co r r espo ist ing C- 6 t o f r o e is insu a nd pr ices elem r r ent ly M e t h a nd pr o per t y ent e X h a v e end t a g la t ed t ex r o u t j ect e elem cinem is cu u m pr o per t ies nce t h m n ent s f r o a s set f f icient ent s. F ct ed ( t h o r ) m a r e pr esent u ilt p ent s is enco u nding m u ses t h t h e t ex o del o b e elem t . I n t h ident if ica t io t h is r ea so e non- n u i l n, w it h nt er ed, o u o ne) . e t h y o e u j ect . ent na m e e ca se o f n since it y in t h in need t o t o t h e a ppea r s ch eck Appendix Listing C { S av e -6 tex : u t { R ep l ac un ct i on b eg C e j e c t m to ontentH ap o p and d e rop l p e r ty p v ame: onsec tiv e w h ite e(con s t 2 t h := Length (R lt[ I A sp X S e m iz ed Client s. } tring); ac e Text: l u st o erty S N a rop Element( q u r o riate ame, ormaliz p ler.End localN c N lank a b A Cu s w t ith ri n one ): g s t sp ri ac n g e } t time ; t B v ing o ontent ri, s s c v TMW con con a t procedure f S C: s = [ # 1 ..# 3 2 ] ; r I nd i ex: I nteger; n R es u := Text; i f Length lt (Text) < en Exit; f nd ex i f I (R es b eg i or (R u en d; { R u lt[ I ex] nd es u lt) dow n B lank s ) B lank i ex - 1 ] i ' n n t a 2 o n do d s ) l ear t h en n R es I nd ex - 1 ] := D elete(R es u lt, I nd ex, c u mu nd C learText: en d; u lt[ etu rn th f un ct i on R b eg i e ac u lt := Trim(N := ' ead A l ated ' ; 1 tex ); t s and t ri c f or nex } ; n g n R es F Text en b es nd ' ormaliz e(F Text)); ; eg i i f d; n q ame Mov ie s e f F C s e F P s e F S s e el el el el b N F = MW q i N n N := q i i i f f A s N MW P rices MW S creening n i l = MW N (F Mov = i = ame s igned Mov ie.N s e f F P s e F C inema.N i f i A ame s rice.N s f (F ame A i igned s R igned (F s R ame e = MW F Mov ie.Length := s e f F Mov ie.D s e f F s F Mov ie.S s e f F C s e F C s e F C s e F C s e F C s e el el el t h t h en ead A en nd t h en en q N i q ame N ame = ead A ead := MW S Mov ie.S tars .A d (R ead e f ame = MW S i q y N nops inema.P q i h N f inema.A q i q ame inema.C q i f q N P h one R ead d d MW A s := MW D = A learText learText) t h en nd C learText h en C learText s t h A en nd ar R C learText y B := Tru is ab led A cces = MW P eriod ar D ab t ead and MW ame C nd := = learText) A ead y is B C C nd irections MW nd en C t res R A h en ead and inema.D i is ame N f nd irections N f = A nops ead t A h R := res ame inema.D i d h t y MW = en en learText; nt(R ead := one d N f d = ame R tar is ame t h C irector = N t nd trToI ame q A en learText inema) irector i h C R S D t nd Length MW learText C N q i C rice) := s el en h P := d el h t ie) el el ame := en el t l := F el el ie n el el en l ame q i h Mov creening eg t MW i n N f = n ame rice ie l := q f i ame inema i Mov := h nd h en t A en C learText e led A cces := Tru s t h en s t e h en / 2 4 / 6 0 6 5 6 6 Appendices F P s e F P s e F P s e F P s e F S s e F S s e F S s e F S s e F S el el el el el el el el en rice.P q i eriod := ame MW N f rice.A d q i h q N f N MW cou nt ame q N f = N = ame q N f loat(R h t S trToF loat(R D is nt S S ate ead A nd C learText) ead A nd en loat(R t h h S as s es = MW D igitalS es t := = s creening.S h d d O b ead A nd C learText) ead A nd C learText) en e ou nd := R ion ateTime(R ateTime(R h Tru nd learText) en trToD s C en trToD as ing.A learText) t oP ow C S := es nd := oP S h ate N MW A ate D ame N t trToF ate ead en MW ame learText h tartD ou q en h cou igitalS f C t = creening.D i nd ild End D A lt := MW creening.N i trToF C tartD ame q f S MW creening.End i u := = creening.S i ead d MW ild is q f R A := = ame rice.D i lt ame rice.C i u N f = t h en ead t h j ect(R A nd C learText en ead A nd C learText, F P rice); d; Th e su pplied t ex r epla ces co a nd R e t r im a t h d A e F T e P C w it e x l et sim ply f o r a r pr ices t h r o u g h r t E l st x f u t it m e f r o nct io a r e no t t h t h no r m e eir m f o r t ex t set e a ccu v a lu t h b st a r t s t h m u eing a nd u sed. Th es a r e co e t h S o t ex it y , t t h a o f sing t h a s w f o r is pr o cessing it h e e nex t no t ex er t ed a s necessa r y , elem pr o v su ide Bo o Th lea n pr o per t y ch e o u t a s t h e a t io n inf o r m led a ccess a nd ca ndy nding t . de. e ent s le spa ce ell a s clea r ing nv m e disa b e co r r espo end is a ct iv la t ing da t es. lik ef o r e b h it e spa ce ch a r a ct er s w t h scr eening o u w n per f o r m pr esence, er e y a liz ed r r ences o f is r ea dy b t o a r T r set t ing u w e h s en nt er ed. j ect s t h a t e b spa ce e a nd a r e enco u a T a . H Th e o b t a f ield so t cinem ey S h e u e o ccu r o per t ies t h a t t ick t h d m t iv s n t nsecu e n m t a r e b et h o d, eing o per a t ed o a nd t h e sa v n w er e cr ea t ed in t h ed r ef er ences a r e u sed h e a ppr o pr ia t e er e. NOTE E l e a c li en c u s t h e Th e r et u t e s a r y t h v i e u ga ser per f o r m o f e sh o i c t f r o n g m e n in t h n i n g list s a r e e e u t h t h s in t h e list ed t h r o u x N a g v h i i n e s c i n r a t i n g sed t a e a w e o b t h a n H j e c t e e rri m n m v A n L d t l e l t h M o e e g s . T e h m o g p l s t r u a e u r e b o x t o n o o m w n t h it h n n d t h r e s e e n c l e f r o t h ga t y t a t u r e r s . m r e t i o n a x t h a , E e a n o o t s i n u c d p m n d m o l e n s v i e s , s e d h e t h e o t f r o a e y s h a m v e t h n d e t h r e , t h e r v e e e y t o n t h on a pplica t io o ey f t h ca n b e f o r eo r der s e t h a t t a ch ed ( see L r m . S e o b ist ing e scr een ( a nd du n f o r e a ssig a nd t o et t ing t h e S ent r ies f o r j ect s. Th e C- 7 r ing displa y ned dir ect ly o or t e d displa y , k t ed w a b h - ) is inv en t h e init ia l lo a d) . I t ent . co r r espo i e lef t e f o r m a r e select ed, e client list s t h t h t h s o a ssig nm t h e a t ica lly d o f e t a b t h a r e st r ing a u et h t h it h in ey o x m ne o f t h d e e list b ge t o r e t h ince t h o f n o t s . list a t e n a sso cia t io h b n s e necessa r y e l d e u i g m l e e C t r i b l u - e t h a t on n e i n n e select s o s t h displa y w h o b r po ses. S t h t e c n pr o per t y s As it em b b t a t s m w s u o c n l e r ned m n t e e r et a ining a m ig a t io n pu e I o n es pr o per t y N u i r d t e s e roc na v t h e t n c i c a o o t p t P c d i e t h t t l n r o t s x n i r e g n t e r r e a a e y u f C m n C l i it is ea sy c nding k r o u O b t o j e r et r iev c t t ine ( see L s e inf o r m a t io ent r y . Th is t ech e a ll t h niq u ist ing C- 7 ) . n t o e is Appendix Listing C { h ow : D isp l a sel ec ted procedure Tf rmMov b S -7 eg i n w i t h b eg i lb xN av I tems .B eginU I tems .C lear; i f tab I N av pd F Mov s e tab N av I tems := F C s e tab N av I tems := F S i f i f tems m 6 iz ed Client s. l ers .tab istb I ex ox N } av igationC h ange(S end er: TO b j ect); j ect); do .End U pd igation.I av igationC el eg i n w i t h b eg i i f temI nd lick an item to d Tf rmMov ieW atch av I nd ex = C inemas I nd ex = S creenings 0 ; := xN t xN Tab t h en Tab t h en Tab t h en ; ex (lb ontrol lb ies igation.Tab eC ec Mov ate; av procedure = igation.Tab creenings xN ctiv nd ies inemas xN av igation); := isp igation l lb ay xN its av ers d igation; etail .lb xN av ex = Mov s } igationC lick (S end er: TO b do n I temI I i nd 0 0 t h en ex av igation.Tab I ie(TMov tems tab N h Mov s e S h s e S h l ay el < := nd S el ex temI f en m in igation.Tab := lb S ite st o ate; tems lb { ie s igation d; d; v atch ieW en A o etail I el en m A Cu n el b d y C: ow tab N av ; nd ie(I .O igation.Tab b j I nd ex tems .O b nd ex i f ow C i f ow S creening(TS creening(I d etail a mov ie atch ers .S inema(TC tab N av inema(I igation.Tab I ies ects Tab [ h en temI nd ex] )) C inemas Tab t [ nd = j t I ects = S tems .O I temI creenings b j ects h en ex] [ )) Tab t temI nd I h en ex] )); d; en d; { D isp Tf procedure v a b eg i n w i t h b eg i s f rmMov or ieW } h ow Mov ie(Mov ie: TMov ie); r I nd ex: I nteger; Mov ie ed tTitle.Text := N ed tR := Mov ed tLength := F ormatD ed tD irector.Text := D irector; lb xS tars := S tars := S y nops p l ating.Text memS y { ow S h .I w i t h b eg i d; h c inemas inemas .I tems 0 t it is ieR atingText[ R ating] ateTime(TimeF ; ormat, Length ; is ay ; ing at nt } do C lear; f or i f t h I pd ate; nd ex TS creening(F := F S o S creenings creenings .C ou .O b ects j – [ 1 I do nd ex] ).Mov en d d O b F S creenings j ect(TS .O b j ects [ I nd ex] ).C F S creenings .O b j ects [ I nd ex] ); 0 ; C ou nt 0 t lb xC inemas .I temI nd ex pd ate; eP age := ts f U > creening( h en := d; d; pgcD en ic .Text ame; n eginU End en .Lines xC B i tems is h lb w .Text nops A en do n etails .A ctiv h Mov ie; inema.N ame, ie = Mov ie ); 7 6 8 Appendices F r o m t h a t o b int o t h C- 7 a s a n ex co m m b o e co O t h o w w h er na v g r a m ing m b o ina t io click ey r o u o . F h k -8 : A d d sc rmMov h ow Lis [ en d; { E ed t(S nter r eg i n i f b a en ac K K ey xC r u na l m r espo do u ie inv na ieW d creenings l Tf ik b o k r o u e m it s t y pe a nd set t ine is sh sing a k t h e po es displa y nding t o le- click ing es t h ser s, in t h e ev pa g a no t h is list o w er ing t h w t h n in L o f em ist ing st r ing list s, e det a ils o f t h e ent e er ser int er a ct io in t h h a ndler a nd ev ( r eu u a n ent r y lo ent sing sh o ca t es h a ndler t h e f u ns e list w n in L t h e it h t h e cinem ist ing a s C- 8 , co r r espo nding r ea ct s t o nct io w o f na lit y pr essing o f t h t h e do u b e le- ; S h if t: = V K N t _ R ETU R D b lick h or xC a ormat(S F b ord f inemas ou W s , l e-c atch : n. .lb xC d ieW tio ers Tab a rmMov lC iga etail lb e v atch inemas n t h co v a lu e pr o m m l TS if h k ie } b lick lC [ lb es (S end er: TO b j ect); ex] ] )); c, xC inemas .I temI ey D end nd } xC tS D creeningD tems ic .lb mov inemas .I ers inemas K ow n(S er: TO b j ect; tate); en (lb xC g r a m e t h r o u o f a r t h f ile t o Bu t g h t h e R ne o . f le a t h do inemas m u n | P a ra m ); m m w t h s E x e na m nning m et ers f r o enu een st a nda lo es o e o f m w t h it h e t a r g et in D elph X M i y L o u do cu m ent specif y t h is o pt io n. f X M t r ig L g indo plo r er , o u su a nd it y o u r client do cu s y o u select V m pply it w it h t h e na m e o f o pens a nd displa y s t h a t is it s deliv er w ne. Y et er t h is cla ss o f is t y pe in W indo pply u a nd- line pa r a m f ile t y pe f o r pen W su er n h a s b co st et er . R nlo a ded f ile t o def ine t h O o u e a dv a nt a g w new To u e a pplica t io def ine a y rows lo a d a s a o ena b , a nd line pa r a m gh the B 1 i ple. Screening reening ts ey lb a s a S ov d; To Throu o v M j ect s, sim f r o o a r d u tTitle.Text, procedure v es e ey b itio Tf S m ow ir ed pr o cessing . U ple, n a n ent r y e n m a m t h o r th i co ex la r ile o h t ine) . to eg e det a ils a ppr o pr ia t e t o a in- specif ic o b n t o n. F t h e r eq u m o r procedure b G ig a t io es w Listing C { v t h e do t r a ct e scr een. Th e S scr eening s f a ir ly pa r t icu m nt er k E a ich co t h eir pr o ex n t h ple o f it h ies a nd t h client y o u ls o a m ined w v sh j ect , nt r o er y a u a cr o ss t h t o m t h e f ile. e I nt er net . To a t ica lly , a ll y o u do is ent s. do t h iew | e f o llo O p w ing : ns , t io a nd select t h e F il e T y p es t a b . 2 . E x a m ine t h t h a t 3 . . e list w it h ident if y t h pr o g r a m t h a t Add a N 4 dea l ew E p p a l i k no t h w e r eg . N ist er ed f ile t y pes a nd t h o t e t h a t e co r r espo s h o w t o f ile t y pe f o r ea ch nding dea l w t h e m h a s o v M it h I M t h ie- w em a t ch a list E e a sso cia t ed pr o o f t y pe, f ile ex a nd t h e t ensio na m g r a m ns e o f s t h a t t h e . er X M L do cu m ent s b y pr essing e. y p nt er “ a t h em e t y pe, new T o f t h descr ipt io c a t i on / x n, - m “ M ov i ov e - i w e a t W c a h t e c r h ” , e t h e a nd t h e r ” , co ex nt ent t ensio ( M n, I M “ . E m w ) x t y pe, ” . Th e Appendix M I M E t y pe, “ a p p l i c a t i on / x - C: ? ? A Cu , ” ? st o m 6 iz ed Client indica t es t h a t 9 t h e f ile is a pplica t io n specif ic. 5 . 6 P . r ess N E nt er F w t h t h 7 igu . e, e f ile b o f n ( see F r e -4 : Ch a ng “ op T h e t h t h o e a ct io ” , n n. a nd pr ess B e co m m r e C- 4 p e w it h ro t h e n a c s e t o w e t ex o pened is pa ssed t o ig u e lt a nd f ilena m eing a ct io C def a u e pa t h pr o cessing F a it s na m o llo o f f o r ew t h t sea r ch “ % e pr o a nd- line pa r a m ” 1 r y o u r a pplica t io indica t e t h a t g r a m et er f o t o ( h ence t h ea r lier ) . P t h e need f o r r ess O t o K n. e na m sa v e t h e e t h e ) . tio n f o e a sso cia t ed ico r m o n if v y ie -w o u w a tc h e r ish . S d o et c t h u m e nts. e o t h er ch eck b o x o pt io ns if desir ed. 8 . H S a v e t h a v ing do cu u lt s ( see F def ined m ent p w e r esu it h t o t h h a v in y o u y o u r b r new e a n . r o f ile is cr ea t ed t o pa ssed t o e w h ig u t y pe, m w ser , o ld t h client r e C- 5 y ) b o u y pr essing m u st x ex it lo a ds dir ect ly e do t ensio n. N w pr o g r a m o r ena m w w co m m s e r v h int o nlo a ded t ex a s a t h t , e t h er o u it h r s e b l o enev y w e C e m o u t t o n. v ie- w a pplica t io t h a t ch er X M L t h is f ile t y pe is o pened e na m a nd- line pa r a m n. A t em e o f t h a t po r a r y f ile b eing et er . TI P Y o u t h h o t y m e w p a s e e e d w v y o e i t h n c r , e u e d m y t h e o n e u t o s e t s . T n .m w e x e t h u p d i s t o e x t e y p n a o u r o c s s o s i o r n e W s . c e s i a i s t e b d e t h e p e e a n r d t o e ppl s u n i t c o p p a n l y t t h i t h o e e n s e / x c o - r v m r r e o e v r c i t h t e a M - t I M w y a o E t u t y c a h e r e r p e u f o M s i n I M r g , E 7 0 Appendices S F u m m igu r e a ry Alt h o u C g -5 h a dv a nt a g t o A g ne w f il e ty p e lo sing u sing X pr o cessing , t h e b Th e do cu M m enef it s o a pplica t io a pplica t io n in D ent s. By L do cu pr o g r a m w f o r m o v ie -w a tc h ener ic pr o cesso r s ca n h a ndle X es o f M L is t h a t specia liz ed a pplica t io f r iendly X : m h X n elph ent , enev y er L in da t a descr ib i t h a t o u su M d L o c u m in m e nts. a ny a t io n h a ccessed. Th a ed r eceiv new ca n h a v ch a h int er ch a ng er e sh o w f ile t y pe in t h e y h o w ib y o u r W w eb b e r eg r o w l w a y s, eliv s f o r m n o st o b t h e e sent o r e u ns, ca n w r it e la r w ser - it h m t h a t ica lly er ing a o u t client cla ss o f specif ic t o t o ne o f ilit y . o u a u nlo a ded. D o in ca n a lso w pa r t icu ist r y ser it h a nd v a lida t io e a nd leg s sef u is a llo es a nd pr o cesses a f ile is do u eld w ell a s incr ea sed int eg r it y M def ining r e inf o r m ns a nd ea sily a s w f t h e da t a k ick w X M L is t y pe o f o f f a s nev t h er e so ea sy . Co da t a b m pa r e t h is S inding v er sio AX im n discu plem ent a t io ssed in Ch a pt er f 2 t h 2 . e cu m v iew er w it h t h e X M L I ndex T C A Attr interface in C attrib U E S O M , 2 E S o ft D O M , 2 l T m atab 0 m ex C AT U AT AS ex h o ft D p l e, E U m am am m ents in C U co nfig u S E p l e, S 4 S X M O m X m X T m X m T X T m X T m X T m X T m X T m X T M O m X 2 , M m M , 4 M O E 2 l C L 1 D o m l D o cu cep m 2 M O rag m ent interface o ft D O o ft D y p S E x U E p M , M 2 , 7 2 6 O M , 2 7 e interface 4 0 o ft D O U S E am 4 M , 2 3 6 o ft D S O M , tio n ex cep o ft D M l em nl o ad T S cep I m o w O 3 tio n , 5 entatio n interface o ft D O M , 3 0 s p l es co d e, iii D U E S o ft D O M , 2 3 el em ent cl as s , o m I m l em ent cl as s , p l em 7 e cl as s , cl as s , 2 l N am l N o d e cl as s , N o d l N o d eL ex 3 0 ap m l N o tatio n cl as s , X m l O b 2 6 cl as s , 1 E l P ars er cl as s , X m l P ars erE T X m l P ro ces s ing 3 rro r ex ex 3 9 o ft D O M , 1 6 S o ft D O M , 1 6 p l e, 4 4 U am E 0 in C cep tio n, ex 6 ctio n cl as s , 2 3 am 7 d 1 o ft D O M , 2 5 E S 4 0 o ft D O M , 2 5 references U ntity R 3 S p l e, U in C 3 E interface entity 2 4 I ns tru E am ntity 1 4 3 cl as s , T U in C X S entities 6 T E ail in C eM T el in C e- m 5 is t cl as s , o d p l e, U ents 6 6 eference cl as s , ed 2 2 3 entatio n cl as s , 1 am in C 2 y p l D ent interface ex rag m l E l em 0 entF m m m 2 E 2 2 entT o cu m X 0 E 2 o cu ntity 5 ent cl as s , l D ntity R tio n, ata cl as s , l D j M M 5 0 2 0 ectio n cl as s , m l E p l e, 4 p l e, E ex ent cl as s , l E S E U in C aracterD m O 0 u te cl as s , ataS l C O o ft D p l e, U am M 1 8 cep tio n ex h 1 o ft D 7 X m , S E am in C M E U in C d X 3 l Attrib l C O 2 3 S entT in C D 3 , x 2 S M 2 7 3 U in C 5 , to 3 E ents m ex D X X o cu 0 2 , T T D 2 D T T 2 , M O al iz atio n, D T , E entF m ex L O ing , X o cu 0 o ft D ars ing , T d D E no rm T M O o ft D o ft D l o ad T O o ft D S m in C 2 ex am U in C co nv erting p 2 ratio n s ing E , 9 o ft D p l e, U u M ent interface ex U O o cu ata interface E in C m 3 S aracterD o m co S ectio n interface U in C C E am in C C D A s ectio ns in C D U ent interface in C D See C ail o cu C C ex t cl as s , l . as e e- m D C X 0 d U m E D o ft D u tes in C X U E U p l es o w S o ft D O M , 2 6 eference interface E S o ft D co d nl o ad , e iii O M , 2 6 7 2 I ndex S F M S F aç ad e p attern, 5 1 , 5 S 3 T Q G etS AX ex tru V am end p l e, o r fu 6 T nctio n D o ntentH ex am and D p l e, T l er interface 6 ex o am O 4 atch s to m 6 X iz ed cl ient, 5 am ed o d N o d U eM E S ap E u ery L ang u ag e. See S tio n, 5 Q L and l er cl as s x 6 1 cep tio n ex am o ft D p l e, in C o d eL ex U O M , 1 4 S 8 o ft D O M , am p l e, U E S 4 o ft D O M , 1 3 in C U E S o ft D O M , 1 8 ex am p l e, in C U E S 4 0 o ft D O M , 2 no tatio ns in C U E S o ft D O M , 2 m cep U E S ro ces s ing in C U o ft D ins tru E S am in C p l e, U E S 3 M , 3 3 , 3 7 O M , 2 3 O M , 2 3 ex im m p l e, p l e, p am l e M 6 o cu ex am m l E ex am m ail 0 6 x rans fer P ro to co l . rag m y p p l e, 3 o d m l N ex am m l N ex am m l O ex am o d 1 2 3 eL ap 4 1 el 3 2 4 cl as s , 3 0 7 l P ars er cl as s , ars erE m l P ro ces s ing ex am m l T ex am 3 3 rro r ex 3 cep I ns tru tio n, 3 2 M 1 9 L See S M T P am l : s p P ratio n fo rm p l e, ace, 4 6 , at, 4 7 3 2 ath in C U E S o ft D O M , 6 ctio n cl as s , 9 ex t cl as s , p l e, 3 0 o d p l e, 6 1 4 0 o tatio n cl as s , j M 2 cl as s , 6 is t cl as s , p l e, 3 0 6 8 4 p l e, 6 5 eM e cl as s , p l e, 2 2 3 entatio n cl as s , l P X ent cl as s , e cl as s , eference cl as s , N p l e, b 7 0 ed o d 2 9 4 am am l em cl as s , p l e, 0 0 p ntity R l N m m X 0 T entF entT 4 ntity 2 2 0 m l E m 2 0 4 p l e, 2 2 ata cl as s , ent cl as s , l N ex ex as cal p l e, 4 m p l e, o cu 2 0 ent cl as s , o cu 1 9 ent cl as s , m AX fo r P 3 aracterD l D 2 ectio n cl as s , p l e, l D , u te cl as s , ataS co nfig u am 1 1 l em m X ex 2 X S AX M 5 l E m 9 o ft D D O cl as s , I m m X P o m X T ctio n interface , 9 am X T ctio ns o ft D ro ces s ing I ns tru ex O 3 o ft D l D X T M m X T O ex X T in C am m P ars ing ex X T 4 o ft D S T h am X T 4 M o m l D X T o tatio n interface E l C m X T S p l e, U l C ex X T al iz atio n m m X T 0 am X T 6 ex X T E l Attrib l C X T is t interface in C no rm E 3 U am S m X T interface e interface ex S Q p l e, M m X T 7 T in C S am M X T er N S 5 1 t interface N T M p l e, v ie- w cu P l tH ex T icro s o ft D ex p efau in C T M p red O 0 M N , ctu in C I C N 4 4 tex t I N 4 4 ex 2 T N , , T G m P L 1 9 4 5 2 3