New Perspectives on XML, 2nd Edition - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

New Perspectives on XML, 2nd Edition

Description:

New Perspectives on XML, 2nd Edition. Tutorial 8. 7. PLACING DATA INTO A STYLE SHEET ... Code snippets can be placed in XHTML files and imported using document ... – PowerPoint PPT presentation

Number of Views:342
Avg rating:3.0/5.0
Slides: 13
Provided by: jama161
Category:
Tags: 2nd | xml | edition | new | perspectives | style

less

Transcript and Presenter's Notes

Title: New Perspectives on XML, 2nd Edition


1
TUTORIAL 8 Session 3
CREATING ELEMENT GROUPS
2
OBJECTIVES
  • Access secondary source documents

3
WORKING WITH MULTIPLE SOURCES
  • Create a reference to another source document
    Within a style sheet
  • Syntax document(object,base)
  • Sample document(firms.xml)
  • Object is either
  • Xml file name
  • Xml element containing file name
  • Base
  • Defines base URI for resolving relative references

4
WORKING WITH MULTIPLE SOURCES
5
WORKING WITH MULTIPLE SOURCES
  • Referencing elements
  • document(firms.xml)/firms/city
  • Good practice
  • Create a variable for external document
  • Keep track of context node
  • Store values to be matched between documents in
    variables

6
WORKING WITH MULTIPLE SOURCES
7
PLACING DATA INTO A STYLE SHEET
  • Data can be placed directly in style sheet
  • Easier to manage a single file
  • Data should be placed in its own namespace
  • Data must be direct child of ltxslstylesheetgt

8
PLACING DATA INTO A STYLE SHEET
  • Syntax
  • ltxslstylesheet version1.0
  • xmlnsxslhttp/www.w3.org/1999/XSL/Transform
  • xmlnsprefixdata_namespacegt

9
PLACING DATA INTO A STYLE SHEET
  • Sample
  • ltxslstylesheet version"1.0"
  • xmlnsxsl"http/www.w3.org/1999/XSL/Transfom
    xmlnsdata"http//www.data_elements.com"gt

10
PLACING DATA INTO A STYLE SHEET
  • To access stylesheet data
  • Syntax document()
  • Sample document('')/xslstylesheet/dataagents/da
    taagent

11
INSERTING CODE SNIPPETS
  • Can be used to contain standard heading or banner
  • HTML code placed in XHTML file
  • To use
  • ltxslcopy-of selectdocument('heading.html') /gt

12
SUMMARY
  • Multiple XML documents can be used by a
    stylesheet and opened with the document()
    function
  • Data can be inserted directly into the stylesheet
  • Code snippets can be placed in XHTML files and
    imported using document()
Write a Comment
User Comments (0)
About PowerShow.com