340 likes | 434 Views
Learn about XML syntax and its integration with HTML, CSS, and JavaScript. Explore XML data binding, formatting, and display methods with practical examples. Enhance your web content management skills with Core FOCUS.
E N D
Managing Web Content With Core FocusAnd HTML/XML Part IISummit 2001, Orlando Desert, California Bob Hughes and Laura Voss-Allen, California State University, Haywardrhughes@csuhayward.edu, lvoss-allen@csuhayward.eduNORCAL FUSE: http://www.csuhayward.edu/FOCUS/ncalibug.htm
Presentation Section II • Custom XML Content and Data Generation with Core FOCUS • HTML and XML Integration • Data Separation and Binding • True Paging with JavaScript Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
What is XML? • XML = Extensible Markup Language • Per W3C – “XML is a subset of SGML…XML has been designed for ease of use…with both SGML and HTML.” • Unlike HTML, XML does not have a fixed set of predefined elements. Instead XML has only a very basic syntax allowing the XML author to create elements and name them. • XML Syntax is flexible but strict (not forgiving like HTML) • XML is not a replacement for HTML, it is complementary Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
What is XML? (cont’d) • XML documents are structured in a Treelike hierarchy • Element names can and should be descriptive • Elements are nested within other elements • Can be used to describe chapters in a book, database fields, etc… • Supports HRMML, CML, MathML, GedML, MusicMl and more… Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
Basic XML Rules • Document must have only one top-level/root element • Elements must be properly nested • Elements must have start and end tags and tag names must match(case sensitive) Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Notes… • Easy to learn – choose applications wisely - may not benefit much, depending on app • Separation of data from formatting code - i.e. "data islands" - a big benefit! • Paging buttons + other HTML/Java/JavaScript/VBScript Integration an advantage • hrefs not bindable - disadvantage Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
Simple XML Layout • Uses Minimum Amount Of XML Code To Convert Focus Report To XML Format • Unlike HTML Minimum Effort, Results Produces only Rough Looking Tree Based Expandable View • Requires Very Little Effort Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Tag Elements XML Declaration Document/Root Element Elements Nested With Document Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
Simple XML Layout Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
Display Methods for XML Documents • Style Sheet Linking • CSS (standard HTML Style sheet language) • XSL,XSLT (newer, more powerful XML oriented) • Data Binding** • Link from HTML Page • Bind standard HTML Elements • e.g. SPAN, TABLE • Scripting • After linking from HTML Page use JavaScript, VBScript etc. for access and manipulation Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Formatting with CSS Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Formatting with CSS CSS File Reference Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Formatting with CSS Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Formatting with XSL • XSL=Extensible Stylesheet Language • Linked to an XML document like CSS • XSL provides more power • Present data in any order or arrangement • Freely modify or add information • Sort and Filter XML Data • May include scripts Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Formatting with XSL Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Formatting with XSL Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
HTML/XML DATA BINDING • Used for displaying XML Data from within a conventional HTML page. • Links HTML elements to XML Data File elements • Works only with symmetric XML Documents such as a database with records and fields Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
Main HTML/XML Binding Steps with Core Focus... • Use DEFINE Facility For XML and HTML Tag Creation • Incorporate XML and HTML Tags into Focexec for XML and HTML Files • Save XML and HTML Files via WP Hold • Use FTP Dynamic Focexec to move to any IP address (Web Server, etc.) Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML TAG DEFINES Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
HTML/XML Data Binding • Tables Used For Data Presentation • Font Sizing and Color Control • XML Links added to HTML Page • HTML and XML Files Generated • Javascript Contols Used For Paging against Bound XML Data File Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
HTML with XML Data Binding(1) Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
HTML with XML Data Binding(2) Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
HTML with XML Data Binding(3) Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
HTML with XML Data Binding(4) Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
HTML > HTML/XML Links Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
HTML W/ All Data Embedded Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
HTML with XML Data Binding Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Parsers • MS IE v5.5 (built-in parser) • MSXML v4.0 • MS XML Validation Tool (command line) • Xmlint.exe @www.microsoft.com/xml • Netscape v6.01 (built-in parser) • Online Brown University XML Validator • Wide Variety of XML Parsers/Validators written in Java ‘on the web’ Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Parsers-MS XML Validation Tool (command line) Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Parsers-MSIE v5.5 Element Tag Name Mismatch Error Found Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Parsers-Netscape v6.01 Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Validation-Brown Univ http://www.stg.brown.edu/service/xmlvalid/ Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
XML Validation-Brown Univ http://www.stg.brown.edu/service/xmlvalid/ Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward
References • Books • MS Press Step by Step XML • Addison-Wesley XSLT Working with XML and HTML • Web Sites • www.microsoft.com/xml • www.w3c.org/xml • www.xml.com • www.xml.org • Presentation Update • www.csuhayward.edu/FOCUS/summit01 Summit 2001 - Bob Hughes & Laura Voss-Allen, Cal State Univ., Hayward