次の方法で共有


setProperty Method (Windows Embedded CE 6.0)

1/6/2010

Used for setting the SelectionLanguage or SelectionNamespaces internal properties (flags).

Script Syntax

objXMLDOMDocument2.setProperty(name, value);

Remarks

Ee502016.collapse(en-US,WinEmbedded.60).gifScript Parameters

  • name
    The SelectionLanguage value.
  • value
    Either the "XPath" or "XSLPattern" value.

Ee502016.collapse(en-US,WinEmbedded.60).gifScript Return Value

None.

Ee502016.collapse(en-US,WinEmbedded.60).gifC/C++ Syntax

HRESULT setProperty(
  BSTR name,
  VARIANT value
);

Remarks

Ee502016.collapse(en-US,WinEmbedded.60).gifC/C++ Parameters

  • name
    [in] The "SelectionLanguage" value.
  • value
    [in] Either "XPath" or "XSLPattern".

Ee502016.collapse(en-US,WinEmbedded.60).gifC/C++ Return Values

  • S_OK
    Value returned if successful.
  • E_FAIL
    Value returned if name or value is invalid.

Ee502016.collapse(en-US,WinEmbedded.60).gifRequirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

General Remarks

The following table shows properties that you can set using this method. Existing properties from DOMDocument are not accessible through this method. White space is not stripped or normalized in property names or values.

Name Value

SelectionLanguage internal property (flag)

"XPath" or "XSLPattern"

The SelectionLanguage property defaults to "XSLPattern". This property indicates the type of query the user plans to pass into selectNodes or selectSingleNode. "XSLPattern" is the default for backward compatibility. This flag applies to all nodes whose ownerDocument property points to this document object. Therefore, if a given node is moved to a different document, its selectNode behavior may change depending on the SelectionLanguage setting in the new document. The following Jscript example on the client shows how to set the SelectionLanguage to XPath for the xmldoc object.

var xmldoc = new ActiveXObject("Msxml2.DOMDocument");
var selection; 
xmldoc.loadXML ("<Customer><Name>Microsoft</Name></Customer>");
selection = xmldoc.selectNodes("Customer/Name");
alert(selection.expr + " -- " + selection.item(0).xml);

SelectionNamespaces internal property (flag)

A space delimited set of Namespace names.

For example:

oDomDocument.setProperty("SelectionNamespaces", 
"xmlns:example1='http://myserver.com' 
xmlns:example2='http://yourserver.com'");

With the SelectionNamespaces internal property (flag), the selectSingleNode method and selectNodes method can now use qualified names.

This method applies to the following interface:

IXMLDOMDocument2.

See Also

Reference

XML DOM Methods

Concepts

selectNodes Method
selectSingleNode Method