17. Tree Structure of XML <?xml version="1.0" encoding="utf-8"?> <presentation> <slide title="Markup Example”> <bullet>Captivating point 1.</bullet> <bullet>Captivating point 2.</bullet> </slide> </presentation> If <slide> does not allow mixed content If <slide> allows mixed content (text and elements) presentation slide bullet bullet text text presentation slide text bullet text text bullet text text
18.
19. Well-formed vs. Valid XML <?xml version="1.0" encoding="utf-8"?> <presentation> <slide title="Markup Example”> <bullet>Captivating point 1.</bullet> </slide> </mess> <?xml version="1.0" encoding="utf-8"?> <presentation> <slide title="Markup Example”> <callout>Look here!</callout> </slide> </presentation> <?xml version="1.0" encoding="utf-8"?> <presentation> <slide title="Markup Example”> <bullet>Captivating point 1.</bullet> </slide> </presentation> This XML is not well-formed . The <presentation> start tag does not have a matching end tag. This XML is well-formed but not valid . Our hypothetical schema does not allow a <slide> to contain a <callout>. This XML is both well-formed and valid
26. Tools for Processing XML and DXL XML DXL Application-specific (e.g. DXL Importer ) Import some data from XML format XSLT Transform it DOM SAX Parse and process it Network protocols Send it Files and Databases Store it Application-specific (e.g. DXL Exporter ) Export some data to XML format Tools Use
63. DXL to Excel XML Mapping Armed with this data, I created an XSLT style sheet to convert a set of DXL documents to an Excel XML spreadsheet. See PlayersDxlToExcel.xslt Copy boilerplate content (from OnePlayerExcel.xml) that precedes and follows the actual workbook data <Workbook> <database> For each <document>, generate a <Row> <Row> <document> For <item>s of interest, generate a <Cell> Generated any computed <Cell>s <Cell> <item> XSLT Style Sheet pseudo-code Excel XML DXL