references id and idrefs n.
Skip this Video
Loading SlideShow in 5 Seconds..
References, ID and IDREFS PowerPoint Presentation
Download Presentation
References, ID and IDREFS

play fullscreen
1 / 12

References, ID and IDREFS

77 Views Download Presentation
Download Presentation

References, ID and IDREFS

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. References, ID and IDREFS Elena Pierazzo 2006-2007

  2. Cross references We have provided a list (see section 3.5) of bishops of Rochester... We have provided a list (see page 96) of bishops of Rochester...

  3. How can we do that? • Typing the text! • But what if the number of sections changes or new paragraphs are added? • All the internal references should be edited by hand… • There’s a better way!

  4. Anchors and links • We put a unique identifier to the object that need to be referred • We put a link to the identifier where we need the reference

  5. Section 2 The SICK ROSE O Rose thou art sick. The invisible worm, That flies in the night In the howling storm: Has found out thy bed Of crimson joy: And his dark secret love Does thy life destroy. In the commentary, somewhere …In the Stick Rose poem (see section 2) the author tries to… An example id=stkRs ref=stkRs

  6. <h4>Section 2</h4> <h3><a name="stkRs"></a>The SICK ROSE</h3> <div> O Rose thou art sick.<br> The invisible worm,<br> That flies in the night<br> In the howling storm: </div><div> Has found out thy bed<br> Of crimson joy:<br> And his dark secret love<br> Does thy life destroy.<br> </div> …In the Stick Rose poem (see the text <a href="#stkRS">here</a>) the author tries to… HTML example

  7. And XML? • A cross reference system has to be provided in the DTD first!

  8. DTD: two special kind of attributes • ID : provide a unique identifier • IDREF: provide a reference to an identifier placed somewhere in the text

  9. For instance… <!ELEMENT title (#PCDATA)> <!ATTLIST title ident ID #IMPLIED> <!ELEMENT link (#PCDATA)> <!ATTLIST link refTo IDREF #REQUIRED> Type of attribute Attribute name Default value

  10. <poem> <title ident="stkRs">The SICK ROSE</title> <stanza> <line>O Rose thou art sick.</line> <line>The invisible worm,</line> <line>That flies in the night</line> <line>In the howling storm:</line> </stanza> <stanza> <line>Has found out thy bed</line> <line>Of crimson joy:</line> <line>And his dark secret love</line> <line>Does thy life destroy.</line> </stanza> </poem> <comment> <p> …In the <link refTo="stkRS"> Stick Rose</link> poem the author tries to… </p> </comment> The texts…

  11. …and the XSLT <xsl:template match=“title”> <h3> <a name=“{@ident}”></a> <xsl:apply-templates/> </h3> </template> <xsl:template match=“link”> <xsl:apply-templates/> (see the text <a href=“#{@refTo}”>here<a>) </xsl:template>

  12. Exercises • Exercise 2, chap. 2