www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
 IMPORT Processing Instruction
IMPORT Processing Instruction

Imports a tag definition from an element behavior.

Syntax

<?IMPORT
    namespace = "sNameSpace"
    implementation = "sImplementation"
>

Attributes

namespace
Required. String that specifies the previously-defined namespace into which the tag definition is imported.
implementation
Required. One of the following values:
#defaultAn element behavior built into Microsoft Internet Explorer 5.5 or later.
#objectIDString that specifies the id attribute of an object tag.
sImplementationString that specifies the HTML Component (HTC) file that contains the tag definition.

Processing Instruction Information

Number of occurrencesunlimited
Parent elementsBODY, head
Minimum availabilityInternet Explorer 5.5
Minimum operating systems Windows 95, Windows NT 4.0, Windows CE 4.0

Remarks

Multiple instances of the IMPORT processing instruction (PI) can be used on a Web page.

The value of a XMLNS attribute, defined in the html tag, must correspond to the value of the namespace attribute defined in the IMPORT processing instruction. Otherwise, the imported tag definition cannot be used.

An imported tag will not render if the value of the implementation attribute is not valid. If you are using an HTC file, it must comply with the same security rules as all behaviors. For more information about security, see Introduction to DHTML Behaviors.

The IMPORT PI can be placed anywhere before the closing tag of the document body. However, the IMPORT processing instruction must be placed before the first instance of a custom element that uses the imported tag definition. If the IMPORT PI is placed after the custom element, the behavior does not attach to the custom element. This also means that the document.write method should not be used to add the IMPORT PI to a document.

As an alternative to the IMPORT PI, use the doImport method to dynamically import an element behavior. The doImport method is used in conjunction with the createElement method to insert a custom element to which an element behavior is attached.

The IMPORT processing instruction is only processed during the initial parsing of the document. Therefore, a document that uses an element behavior must include the IMPORT PI in the HTML file. Provided that the IMPORT PI is specified in the primary document, the document.write method can be used to add the custom element and attach to the behavior.

The IMPORT PI is not a member of the all collection. However, the content of the IMPORT PI can be accessed from the document.body.innerHTML property.

Example

The following sample illustrates the use of the IMPORT processing instruction. The XMLNS attribute defined in the html tag is defined to match the namespace attribute in the IMPORT processing instruction.

<HTML xmlns:games>
<?IMPORT namespace="games" implementation="checkers.htc" >
<BODY>
<games:checkers />
</BODY>
</HTML>

Standards Information

There is no public standard that applies to this element.

See Also

doImport, Introduction to Viewlink, About Element Behaviors, DeviceRect
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG