Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. Using XSLT To Transform XML Brian E. Travis Architag International Corp
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. XSL Extensible Stylesheet Language HTML: "Format without Structure" HTML: "Format without Structure" Typesetting language Typesetting language Not extensible Not extensible CSS: "Enhanced Format, No Structure" CSS: "Enhanced Format, No Structure" Stylesheet language Stylesheet language Overrides default formatting for HTML, but annot change basic structure of the document Overrides default formatting for HTML, but annot change basic structure of the document XML: "Structure Without Format" XML: "Structure Without Format" Defines "elements" using "tags" Defines "elements" using "tags" Creates hierarchical structure of information set Creates hierarchical structure of information set
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. XSLT "Adding Format to Structure" Transforms XML to XML Transforms XML to XML Declarative programming language Declarative programming language Creates formatted output Creates formatted output Does limited processing Does limited processing
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. Quiz May 5, 2000 May 5, 2000 May 5, 2000
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. XSLT Operation XSLTransformer Output (x) Stylesheetxmlns:xsl Source Tree (your XML) XSLT
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. Example In XRay
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. XSLT Stylesheet Architecture <xsl:stylesheet version="1.0" xmlns:xsl=" L/Transform">...</xsl:stylesheet> Start tag for stylesheet document, containing XSL Namespace indicator Start tag for stylesheet document, containing XSL Namespace indicator Template rules and other stuff Template rules and other stuff End of stylesheet End of stylesheet
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. XSLT Template Rule <DIV STYLE="font-family:sans-serif; font-weight:bold; color:blue;">
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. Patterns ParagraphElement abstract/paragraphParent chapter//quoteAncestor chapter[synopsis]Filter Attribute filter (specified) ] Attribute filter (value)
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. <xsl:templatematch=something/> XSLT Template Rule
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. XSLT Stylesheet <xsl:stylesheet version="1.0" xmlns:xsl=" Temperature °F Wind: mph
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden Current conditions 76 Temperature: ° F Wind: mph XSLT Transformation
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. Demonstration: XSL for Documents Create stylesheet for complex document Create stylesheet for complex document Run in browser Run in browser
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. Demonstration: XSL On The Server Get XML document from server Get XML document from server Article.xml Article.xml Apply stylesheet, transform, and deliver HTML to the browser Apply stylesheet, transform, and deliver HTML to the browser Article.asp Article.asp Article.xsl Article.xsl
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. XSLT Operation XML XSL (TOC) XSL(Abstract) XSL (Full) HTML (TOC) HTML (Abstract) HTML (Full) XSL Processor (HTML)
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. Demonstration: XML Data Islands Create HTML document with XML data islands Create HTML document with XML data islands Article.xml Article.xml Article-toc.xsl Article-toc.xsl Article-abstract.xsl Article-abstract.xsl Article-full.xsl Article-full.xsl Article-wtoc.xsl Article-wtoc.xsl Switch stylesheet under script control Switch stylesheet under script control ApplyStyle.htm ApplyStyle.htm
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. Case Study: Newsletter XML-enabled Web Site
Copyright © 1999, Architag International Corporation. All rights reserved. Use without express written permission from Architag International Corporation is expressly forbidden. </Tutorial> Tech Ed 2000 Materials Tech Ed 2000 Materials XML and XSL XML and XSL