360 likes | 379 Views
Learn the basics of XSLT and how to apply it to ePublisher. Explore XML, XSLT programming language, and XML namespaces.
E N D
Conference Number: 805-309-0248Participant Code: 880-0006 Power HourEnd of 2012 XSLTBasics and applying to ePublisher
Power Hour – End of 2012 Agenda • XSLTBasics and applying to ePublisher • Survey Results • Webinar Schedule
Power Hour – End of 2012 XSLTBasics and applying to ePublisher
XSLT – Basics and applying to ePublisher Experience – Snapshot from January 2012
XSLT – Basics and applying to ePublisher What are your goals for this session?
XSLT – Basics and applying to ePublisher What are your goals for this session? • I'm a beginner on XSLT. I want to learn as much as possible about it. • I need to have background on Why, How, & Where XSLT is used • Is there a way to use XSLT to write a line to a text file?
XSLT – Basics and applying to ePublisher What are your goals for this session? • The logic of the ww namespace; I see this in all the xsl files • How XSLT connects in different ePublisher files? For example, how does the default.wwconfig connect to content.xsl file? Power Hour ArchiveOctober 2012
XSLT – Basics and applying to ePublisher What are your goals for this session? • Mainly about templates • How to customize the output • One goal (possibly unrelated and perhaps performed through CSS instead) is to customize Reverb's toolbar/header Power Hour ArchiveAugust & September 2012
XSLT – Basics and applying to ePublisher What are your goals for this session? • Documentation/Information on the ePublisher proprietary tags and schema implemented with WebWorks such as: • WebWorks-Engine-Files-Schema • WebWorks-Document-Schema • WebWorks-Page-Template-Schema • WebWorks-XSLT-Extension-Log • WebWorks-XSLT-Extension-FileSystem WebWorks WikiDevCenter/Documentation
XSLT – Basics and applying to ePublisher What are your goals for this session? • How to use the <xsl:import href="wwtransform:super" /> to code a format override that requires edits in multiple places within content.xsl. How do the multiple "super" entries align with the default content.xsl? As an example, how would the "super" be used to code for a character-based dropdown feature? Study Hall
XSLT – Basics and applying to ePublisher Topics to cover • XML • XML Namespaces • XSLT • XPath • XSLT Output • Using XSLT to get real work done
XSLT – Basics and applying to ePublisher Tools to help us learn • WebWorks Toystoys.webworks.com • Text Editor (or XML/XSLT editor) • ePublisher Designer
XSLT – Basics and applying to ePublisher XML • Standard syntax for representing any type of structured data • XML Declaration<?xml version="1.0" encoding="UTF-8" ?> • Elements<element> • Attributes<element attribute="value">
XSLT – Basics and applying to ePublisher XML <?xml version="1.0" encoding="utf-8"?><Document> <Content> <Paragraph id="501" stylename="Heading1"> <TextRun id="501-1" stylename="Bold"> <Text value="Example WIF Document" /> </TextRun> </Paragraph> </Content></Document>
XSLT – Basics and applying to ePublisher XML Namespaces • Identify elements with their specification • URL – http://www.w3.org/1999/xhtml • URN – urn:WebWorks-Document-Schema • Difference? • URLs may be resolved by XSLT processors • URNs are just names and are not resolved
XSLT – Basics and applying to ePublisher XML Namespaces • Allow you to mix XML tags in a single XML file • xmlns:html="http://www.w3.org/1999/xhtml" • xmlns:xsl="http://www.w3.org/1999/XSL/Transform" • Same element name possible in both namespaces • <html:choose> • <xsl:choose>
XSLT – Basics and applying to ePublisher XML Namespaces <?xml version="1.0" encoding="UTF-8"?><wwdoc:Document version="1.0"xmlns:wwdoc="urn:WebWorks-Document-Schema"xmlns:html="http://www.w3.org/1999/xhtml"> <wwdoc:Content> <wwdoc:Paragraph id="1"> <wwdoc:TextRun id="1-1"> <wwdoc:Text value="Text in a paragraph." /> </wwdoc:TextRun> <html:div>Embedded HTML markup</html:div> </wwdoc:Paragraph> </wwdoc:Content></wwdoc:Document> xmlns:html="http://www.w3.org/1999/xhtml" <html:div>Embedded HTML markup</html:div>
XSLT – Basics and applying to ePublisher XSLT • Programming language for transforming XML files • Programming language that is itself written in XML
XSLT – Basics and applying to ePublisher XSLT <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0"xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:wwdoc="urn:WebWorks-Document-Schema"> <xsl:template match="wwdoc:Paragraph"> <html:div> Matched a paragraph! </html:div> </xsl:template></xsl:stylesheet> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:template
XSLT – Basics and applying to ePublisher XPath • Query language built-in to XSLT • Allows you to query XML data as if it were a database • Basis of XSLT processing
XSLT – Basics and applying to ePublisher Goal: Select the wwdoc:Text element XPath //wwdoc:Paragraph[@id='1']/wwdoc:TextRun[1]/wwdoc:Text/@value //wwdoc:Text/@value <?xml version="1.0" encoding="UTF-8"?><wwdoc:Document version="1.0"xmlns:wwdoc="urn:WebWorks-Document-Schema"xmlns:html="http://www.w3.org/1999/xhtml"> <wwdoc:Content> <wwdoc:Paragraph id="1"> <wwdoc:TextRun id="1-1"> <wwdoc:Text value="Text in a paragraph." /> </wwdoc:TextRun> <html:div>Embedded HTML mark up</html:div> </wwdoc:Paragraph> </wwdoc:Content></wwdoc:Document> <wwdoc:Text value="Text in a paragraph." />
XSLT – Basics and applying to ePublisher XSLT Output • XSLT 1.0 supports one default input and one output • ePublisher extends XSLT 1.0 to support multiple output files of different types • XML • HTML • XHTML • Text
XSLT – Basics and applying to ePublisher Using XSLT to get real work done • Simple case for XSLT is taking a single input file and outputting to one result file • Real world XSLT is taking input from multiple files and outputting them to one or more result files • ePublisher supports the real world case;-)
XSLT – Basics and applying to ePublisher Tips • Create XSLT transforms that perform a single, clear operation • Process data multiple times if necessary to derive answers to complex questions • Combine two files into one to ensure clear code ePublisher tries to follow these rules!
XSLT – Basics and applying to ePublisher Resources • WebWorks Toys – XSLT Transforms • XML Namespace Name: URN or URL? • Understand XML Namespaces • XSLT 1.0 & XPath 1.0 Quick Reference • Power Hour – January 2012 • Power Hour – September 2010
Power Hour – End of 2012 Survey Results
Survey Results When to meet:
Survey Results Voice Options:
Survey Results Topics to cover:
Survey Results Topics to cover: • The order that underlying ePublisher files are processed during DITA generation and what is happening at each processing point • Checklist for deploying Reverb to a web server; what am I supposed to tell my IT people? What should I check - browsers/web server settings, etc. Power Hour ArchiveOctober 2012
Survey Results Topics to cover: • Cross-applying web styles from one output format to another (e.g., WebHelp styles to Reverb or EPUB) • Detailed scripting for AutoMap • DITA to XSL-FO and PDF Show Me
Power Hour – End of 2012 Webinar Schedule
Webinar Schedule Power Hour: • January 31th at 2:00pm Central • ePublisher - Invoking tools and post-processing outputs Sign-up atwww.webworks.com/eSchool/Power_Hour/
Webinar Schedule Show Me: • December 20th at 10:30am Central • Learn what the ePublisher platform can do for you • Repeats monthly on the 3rd Thursday Sign-up atwww.webworks.com/eSchool/Show_Me/
Webinar Schedule Study Hall: • December 12th at 1:00pm Central • Open forum for ePublisher users • Repeats monthly on the 2nd and last Wednesdays Join atwww.webworks.com/eSchool/Study_Hall/
Power HourEnd of 2012 XSLTBasics and applying to ePublisher