次の方法で共有


Step 5: Adding Other Documents (Windows Embedded CE 6.0)

1/6/2010

Not all documents are sales figures. You can incorporate new XML into your output from external documents through the document() function. This function can take as an argument the relative or absolute Uniform Resource Locater (URL) of the document you want to retrieve as a string or a node in which the text value of that node resolves to a URL. With document(), you load the entire contents of the document, and can even manipulate them as if the document was itself an XML document using XML Path Language (XPath) and XSLT expressions.

You will create a document called Ancillary.xml that will contain a watermark and a copyright notice for the report.

To create Ancillary.xml

  1. Paste the following text into your HTML editor.

    <document>
      <watermark></watermark>
      <copyright></copyright>
    </document>
    
  2. Save the file as Ancillary.xml.

  1. Open Ancillary.xml.

  2. Paste Lucerne Publishing between the <watermark> and </watermark> tags.

  3. Paste the following copyright information between the <copyright> and </copyright> tags.

    The file should look like this:

    <document>
    <watermark>Lucerne Publishing</watermark>
    <copyright>Copyright 2000, Lucerne Publishing. All Rights Reserved.</copyright>
    </document>
    
  4. Save Ancillary.xml, and then open Transform.xsl.

  5. To load the ancillary document into the variable named ancillary in Transform.xsl, paste the following after the <body> element.

          <xsl:variable name="ancillary" 
               select="document('ancillary.xml')"/>
    
  6. To add the watermark, paste the following directly below the lines that you just added.

          <div style="position:absolute;font-size:96;font-family:Times New Roman;color:#F0F0F0;z-index:-1">
    <xsl:value-of select="$ancillary//watermark"/>
          </div>
    
  7. To add the copyright notice, paste the following directly above the </BODY> tag.

            <div style="font-size:9">
            <xsl:value-of select="$ancillary//copyright"/>
        </div>
    
  8. Save Transform.xsl.

    Your final result should look like this:

    Ee502070.ea333fac-1124-41e3-80a9-974f2fbb828b(en-US,WinEmbedded.60).gif

See Also

Tasks

Tutorial: Getting Started with XSLT
Step 4: Adding Conditional Statements

Concepts

Exploring XSLT Capabilities
XSLT Developer Guide