Interface IXPathEvaluator

Interface IXPathEvaluator

ชื่อพื้นที่: Aspose.Html.Dom.XPath การประกอบ: Aspose.HTML.dll (25.5.0)

การประเมินการแสดงผล XPath ให้โดย Aspose.Html.Dom.XPath.IXPathEvaluator

[DOMNoInterfaceObject]
[ComVisible(true)]
public interface IXPathEvaluator

Methods

CreateExpression(ลวด, IXPathNSResolver)

สร้างการแสดงผล XPath parsed กับพื้นที่ชื่อที่แก้ปัญหา นี่เป็นประโยชน์เมื่อคําอธิบายจะใช้ใหม่ในแอพลิเคชันเนื่องจากทําให้มันเป็นไปได้เพื่อประกอบสายการแสดงออกในรูปแบบภายในที่มีประสิทธิภาพมากขึ้นและโซลูชันก่อนทั้งหมด prefix nameespace ที่เกิดขึ้นภายในการแสดงออก

[DOMName("createExpression")]
IXPathExpression CreateExpression(string expression, IXPathNSResolver resolver)

Parameters

expression string

สายการแสดงผล XPath จะถูก parsed

resolver IXPathNSResolver

โซลูเวอร์อนุญาตให้การแปลของ Prefix ทั้งหมดรวมถึง “xml” nameespace prefix ในตัวอักษร XPath intoappropriate namespace URIs หากนี้ระบุไว้เป็น ’null’ ใด ๆ nameespaceprefix ภายในคําอธิบายจะนําไปสู่ Aspose.Html.DOMException beingthrown with the code ‘NAMESPACE_ERR’.

Returns

IXPathExpression

รูปแบบที่ประกอบของคําอธิบาย XPath

Exceptions

DOMException

INVALID_EXPRESSION_ERR: เพิ่มขึ้นถ้าคําอธิบายไม่ได้กฎหมายตามกฎของ Aspose.Html.Dom.XPath.IXPathEvaluator

DOMException

NAMESPACE_ERR: เพิ่มขึ้นถ้าคําอธิบายมีพื้นที่ชื่อข้อกําหนดที่ไม่สามารถแก้ไขได้โดย Aspose.Html.Dom.XPath.IXPathNSResolver ที่ระบุไว้

โซลูชัน(Node)

Adapts DOM node to resolve namespaces so that a XPath expression can be easily evaluatedrelative to the context of the node where it appeared within the document. อะแดปเตอร์นี้ workslike the DOM Level 3 method ’lookupNamespaceURI’ on nodes in resolving the namespaceURIfrom a given prefix using the current information available in the node’s hierarchy at the timelookupNamespaceURI is called, also correctly resolving the implicit xml prefix.

[DOMName("createNSResolver")]
IXPathNSResolver CreateNSResolver(Node nodeResolver)

Parameters

nodeResolver Node

ปุ่มที่จะใช้เป็น kontext สําหรับการแก้ปัญหา namespace

Returns

IXPathNSResolver

Aspose.Html.Dom.XPath.IXPathNSResolver ที่แก้ปัญหาพื้นที่ชื่อเกี่ยวกับการกําหนดในช่วงสําหรับ node ที่กําหนด

Evaluate(string, node, IXPathNSResolver, XPathResultType, object)

การประเมินสายการแสดงผล XPath และส่งผลของประเภทที่ระบุหากเป็นไปได้

[DOMName("evaluate")]
IXPathResult Evaluate(string expression, Node contextNode, IXPathNSResolver resolver, XPathResultType type, object result)

Parameters

expression string

สายการแสดงผล XPath จะถูก parsed และประเมิน

contextNode Node

ถ้า Aspose.Html.Dom.XPath.IXPathEvaluator ได้รับ โดย casting theAspose.Html.Dom.Document แล้วนี้ต้องเป็นเจ้าของเอกสารเดียวกันและต้องเป็น aAspose.Html.Dom.Document, Aspose.Html.Dom.Element, Aspose.Html.Attr, Aspose.Html.Dom.Text, Aspose.Html.Dom.CDATASection, Aspose.Html.Dom.Comment, Aspose.Html.Dom.ProcessingInstruction, Aspose.Html.Dom.Dom.Dom.Dom.Dom.Dom.Dom.Dom.Dom.Dom.Dom.Dom.Dom.Dom.D

resolver IXPathNSResolver

“โซลูเวอร์” ช่วยให้การแปลของ Prefix ทั้งหมดรวมถึง ‘xml’ nameespace prefix ในภายใต้การแสดงผล XPath ใน URIs name space ที่เหมาะสม หากนี้ระบุไว้เป็น ’null’ หมายเหตุใด ๆ Nameespace โพสต์ภายในตัวอักษรจะนําไปสู่ Aspose.Html.DOMException ที่จะถูกปล่อยด้วยรหัส ‘NAMESPACE_ERR’.

type XPathResultType

หากระบุ ‘ประเภท’ ที่เฉพาะเจาะจงแล้วผลลัพธ์จะถูกคืนไปยังประเภทที่เกี่ยวข้อง สําหรับผลลัพธ์ XPath 1.0 นี้จะต้องเป็นหนึ่งในค่าของ theAspose.Html.Dom.XPath.XPathResultType enum

result object

“ผลลัพธ์” จะระบุวัตถุผลลัพธ์ที่เฉพาะเจาะจงซึ่งสามารถนํากลับมาใช้ใหม่โดยวิธีการนี้ หากสิ่งนี้ระบุเป็น “ศูนย์” หรือการดําเนินการใช้ผลลัพธ์ที่ระบุวัตถุผลลัพธ์ใหม่จะถูกสร้างขึ้นและนํากลับมาใช้ สําหรับ XPath 1.0 ผลลัพธ์วัตถุนี้จะเป็นชนิด Aspose.Html.Dom.XPath.IXPathResult

Returns

IXPathResult

ผลของการประเมินการแสดงผล XPath สําหรับ XPath 1.0 ผลนี้จะเป็นประเภท Aspose.Html.Dom.XPath.IXPathResult

Exceptions

DOMException

INVALID_EXPRESSION_ERR: ขึ้นอยู่กับคําอธิบายที่ไม่ถูกต้องตามกฎหมายตามกฎของ Aspose.Html.Dom.XPath.IXPathEvaluator

DOMException

TYPE_ERR: เพิ่มขึ้นถ้าผลลัพธ์ไม่สามารถแปลงเพื่อคืนค่าประเภทที่กําหนด

DOMException

NAMESPACE_ERR: ที่เพิ่มขึ้นถ้าคําอธิบายมีตัวอักษร nameespaceซึ่งไม่สามารถแก้ไขได้โดย Aspose.Html.Dom.XPath.IXPathNSResolver ที่ระบุไว้

DOMException

WRONG_DOCUMENT_ERR: ปุ่มมาจากเอกสารที่ไม่ได้รับการสนับสนุนโดยนี้ Aspose.Html.Dom.XPath.IXPathEvaluator

DOMException

NOT_SUPPORTED_ERR: ปุ่มไม่ได้เป็นประเภทที่ได้รับอนุญาตเป็นสภาพแวดล้อม XPathปุ่มหรือประเภทคําขอไม่ได้รับอนุญาตโดย Aspose.Html.Dom.XPath.IXPathEvaluator นี้

 แบบไทย