Chapter Contents |
Previous |
Next |
The Complete Guide to the SAS Output Delivery System |
What Are Links and References? |
An HTML reference names a file for the browser to display. When a browser reads a reference, it displays the referenced file as if it were part of the file that it is displaying. You can't tell by looking at the browser's display that some of the material is in the file that you are actually viewing and that some is referenced.
When you use ODS, the software automatically creates the links and references that you need. You can, however, customize these links to some extent. If you wish to do so, you will need to understand how HTML implements links and references.
Implementing HTML Links and References |
Each link in HTML is implemented with a combination
of two sets of <A> (anchor) tags. One anchor tag, which is the starting
point of the link, has an HREF attribute that identifies the anchor tag to
link to. The other anchor tag, which is the target of the link, has a NAME
attribute. This NAME attribute is what the HREF attribute in the first anchor
tag points to. The value of each NAME attribute in a file must be unique so
that each value of HREF points to a single, unambiguous location. The following
figure illustrates linking within a file:
Linking within a File
The important features at the starting point of this link are
When a link points to a target outside the file that is being displayed, the HREF attribute must include the path to that file. The path can be the path within the file system or the uniform resource locator (URL) of the file. The following figure illustrates a link from one file to another file that is specified with a URL:
Linking to Another File
The important features at the starting point (the anchor) of the link are
ODS provides features that enable you to customize the text that precedes the pound sign and the text that follows the pound sign. For information on how to do this, see the discussions of HTML-file-specification, ANCHOR=, BASE=, PATH=, and GPATH= as well as How ODS Constructs Links and References.
HTML implements references in much the same way as it implements links. The main difference is that a link points to a particular location within a file and that a reference points to the file itself. HTML uses the SRC attribute to identify a file to reference. The value of the SRC attribute is constructed the same way that the value of the HREF attribute is constructed except that there is no pound sign and no text following it.
How ODS Constructs Links and References |
<A href="URL#anchor-name"> |
Note: HTML
references to files use other tags, but the logic for creating the string
that identifies the file is the same as the logic for creating an HREF attribute
(see Implementing HTML Links and References).
The URL in an HREF attribute is composed of information from three options in the ODS HTML statement: the BASE option; the GPATH= or the PATH= option; and the BODY=, the CONTENTS=, or the PAGE= option.
If the file that you are linking to is a high-resolution graphic, ODS uses information from the GPATH= option as the next part of the HREF. (For information on these options, see the discussion of GPATH= and the discussion of PATH=.) The following table shows how ODS uses information from the GPATH= option in the URL in HREF attributes:
If the file-specification in GPATH= is ... | And the URL= suboption is ... | ODS uses this information in the second part of the URL in the HREF attribute*... |
---|---|---|
an external-file or libref.catalog | not specified | the name of the file |
an external-file or libref.catalog | specified, but not NONE | the value of the URL= suboption |
an external-file or libref.catalog | NONE | No information from GPATH= |
a fileref | specified or not specified | No information from GPATH= |
*If you do not specify GPATH=, ODS uses the value of PATH= to create this part of the HREF. |
If the file that you are linking to is not a high-resolution graphic, ODS uses information from the PATH= option as the next part of the HREF. The following table shows how ODS uses information from the PATH= option in the URL in HREF attributes:
If the file-specification in PATH= is ... | And the URL= suboption is... | ODS uses this information in the second part of the URL in the HREF attribute ... |
---|---|---|
an external-file or libref.catalog | not specified | the name of the file |
an external-file or libref.catalog | specified, but not NONE | the value of the URL= suboption |
an external-file or libref.catalog | NONE | No information from PATH= |
a fileref | specified or not specified | No information from PATH= |
Note: If you use a fileref as the file
specification
in the BODY=, CONTENTS=, or PAGE= option in the ODS HTML statement, and you
do not use the URL= suboption in that option, ODS does not use information
from GPATH= or PATH= when it creates the complete URL for any corresponding
HREF attributes.
If you specify the URL= suboption in one of these options, ODS uses the string that you specify instead of the file name.
Note: If you use a fileref as the file specification
and do not use the URL= suboption, ODS does not use information from GPATH=
or PATH= when it creates the complete
URL for the HREF attribute.
The anchor-name comes from the value of the ANCHOR= option.
The following figure illustrates the creation of the HREF:
Creating the Value of an HREF Attribute
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.