Download STYLEVISION 2004 User Manual

Transcript
40
Tutorial
4.3
Including an image
Including an image
An image can be included in the output of the XML document by including a link to it in the
STYLEVISION Power Stylesheet. If the link is explicitly specified in the STYLEVISION Power
Stylesheet, the included image is referred to as a static image—because its address does not,
and cannot, be changed in the XML document. If, on the other hand, the STYLEVISION Power
Stylesheet specifies, instead of the image address, a location in the XML document where the
address is to be found, then the image is dynamic; it changes when the corresponding XML
content changes.
Inserting a dynamic image
In the previous section, we created an input field for the value of the href attribute. This value
provides the address of the logo image, and it can be specified by the Authentic View user. Now
we will create a display for the image that is specified in the href attribute value. Do the
following:
1. Drag the href attribute from the schema tree, and drop it immediately after the start tag
of the CompanyLogo element.
2. In the pop-up menu that appears, select Create Image.
3. In the Insert Image dialog (shown below), switch to the Dynamic tab.
4. Check that the Address field contains a period. This is the XPath expression for the
current node, which is the href attribute (this is the node that was dragged from the
schema tree). If there is no period, then type in one.
5. Click OK.
6. Save your changes.
The Design Document will now look like this:
Notice that the href attribute appears twice in the STYLEVISION Power Stylesheet: first as an
image, then as an input field. This way the user can specify in the input field what image is to be
used; the specified image will be displayed immediately at the point where the image has been
inserted.
STYLEVISION 2004 User Manual
© 2004 Altova GmbH