[ 
http://nagoya.apache.org/jira/browse/XALANJ-1989?page=comments#action_55375 ]
     
Yash Talwar commented on XALANJ-1989:
-------------------------------------

Hi Joe,
The DOM3 XPath Working Note says 
"In a DOM implementation which supports the XPath 3.0 feature, as described 
above, the XPathEvaluator interface will be implemented on the same object 
which implements the Document interface permitting it to be obtained by the 
usual binding-specific method such as casting or by using the DOM Level 3 
getInterface method"


Section 1.3.6  DOM Features at link 
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMFeatures
discuss the ways to check if a feature is available.

In DOM L3 XPath Support in Xalan, if XPathEvaluator and Document interfaces are 
not implemented on same object, then following will return false:

Document doc;
DOMImplementation impl = doc.getImplementation();
if (impl.hasFeature("XPath" , "3.0")  // hasFeature returns false.

{
        XPathEvaluator evaluator = (XPathEvaluator) doc;  // This cast will not 
work;
     // do something
}

In our implementation for DOM L3 XPath Support, the above code test will return 
false.  In Xalan, XPathEvaluator and Document interfaces will not be 
implemented by same object.

However, a user can do the following test:

Document doc;
DOMImplementation impl = doc.getImplementation();
if (impl.hasFeature("+XPath" , "3.0")  // hasFeature returns false.

{
        XPathEvaluator evaluator = (XPathEvaluator) impl.getFeature("XPath", 
"3.0");
        //do something
}


The later test will work if parser that implements DOM LEVEL 3 Specs. and 
relies on Xalan for DOM L3 XPath Support.  In this case, parser needs to create 
an instance of implementation class of XPathEvaluator and return a reference 
back to user.



> Support for DOM Level 3 XPath APIs for an XML parser
> ----------------------------------------------------
>
>          Key: XALANJ-1989
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-1989
>      Project: XalanJ2
>         Type: New Feature
>     Reporter: Brian Minchau

>
> This feature is opened to track support for the DOM Level 3 XPath APIs.
> See http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226/
> The support is intended only for use by an XML parser.
> An XML parser should create an instance of an object that implements the 
> interface  org.w3c.dom.xpath.XPathEvaluator.  The implementation of this 
> interface should be provided by a particular class, such as 
> XPathEvaluatorImpl. The XML parser should created an instance of this class 
> but refer to the created object through a reference as an XPathEvalutor 
> object. The XPathEvaluator and other objects obtained through this interface 
> should also to be refered to via the vendor neutral references:
> org.w3c.dom.xpath.XPathException
> org.w3c.dom.xpath.XPathEvaluator
> org.w3c.dom.xpath.XPathExpression
> org.w3c.dom.xpath.XPathNSResolver
> org.w3c.dom.xpath.XPathResult
> org.w3c.dom.xpath.XPathNamespace

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to