XML, XPath, XPath 구조 및 더 많은 설명
링크 표
초록 및 1 소개
2 배경
XML 프로세서에 대한 3 접근 및 3.1 차등 테스트
3.2 Xpath 발현 생성
3.3 XML 생성
4 평가
4.1 효과
4.2 효율성
4.3 최신 기술과 비교
4.4 Basex 역사적 버그 보고서 분석
5 관련 작업
6 결론, 인정 및 참고 문헌
2 배경
실행 예제. 그림 1은 기본 XML 및 XPATH 개념을 설명 하고이 맥락에서 적용되는 자동 테스트의 문제를 설명하는 데 사용할 수있는 실행 예제를 보여줍니다. 왼쪽은 루트 노드 북이있는 XML 문서를 보여주고 오른쪽에는 XPath 표현식 //*가 표시됩니다.[@id * -1
XML. Extensible Markup Language (XML) is a text format for describing structured data. XML documents are trees that consist of nodes, as illustrated in Figure 1. An XML document has a single root element node (see ). Each element node has a tag name (see Books, Book, and Author). Element nodes can include attribute nodes. For example, two of the nodes have both attribute nodes id and year. An element node can also include child element nodes; in the example, the node contains three child element nodes. Element nodes can hold text contents, which can be of any defined data type. For the node with attribute id = 1, the text content it holds is “A fairy tale”. Attribute nodes are disallowed from holding child nodes. In the example, id and year are integer-typed attribute nodes and the name attributes are string-typed attribute nodes.
XPath. The XPath language is an expression language that allows navigating the XML tree and hierarchic addressing of the element nodes. XPath is at the core of both eXtensible Stylesheet Language – Transformation (XSLT) [7] 그리고 XquerXML에 대한보다 표현력있는 쿼리 언어 [6]. XSLT는 XML 문서를 다른 형식으로 변환하고 XQuery 언어는 XPath 표현식의 슈퍼 세트입니다. XQuery는 XPath를 확장하여 노드 생성자 및 SQL 유사 클로스와 같은 기능을 제공합니다.
xpath 구조. XPath 표현식은 XML 트리의 노드의 선택 및 변환을 설명합니다. 그림 2는 단순화 된 XPATH 3.0을 보여줍니다 [4] W3C XML 1.0 표준에서 EBNF 표기법을 사용한 문법 [3]. 우리는 설립되지 않은 용어를 소개합니다 부분 그리고 섹션 접두사 우리 세대의 접근 방식을 설명합니다
섹션 3.2. XPath 표현식은 하나 이상의 섹션으로 구성되며 섹션에는 하나의 섹션 접두사가 있고 0 개 이상의 사전 예측이 포함되어 있습니다. 그림 1에서 xpath 표현식 //*[@id*(-1)
XPath axes. Axes define the relationship between selected nodes and current context nodes. For example, the axis parent:: selects all parent nodes of current context nodes. If omitted, it is equivalent to child::, which selects all direct children nodes of current context nodes. A name test is a string literal to fetch only nodes with the same tag name. It could also be a wildcard *, which matches all nodes without applying filters. The section prefix //* in the example selects all descendant nodes of the document node, which is all element nodes in the document.
XPath predicates. Predicates in XPath include positional predicates and boolean predicates. Positional predicates contain an expression that evaluates to a single integer and select only values whose position in the context matches the integer value. In the XPath expression /Books/Book[1],,, [1] 위치 사례이며 @id = 1의 노드 인 첫 번째 자식 만 선택합니다. 부울은 주어진 표현식에 따라 현재 컨텍스트 노드를 부울 값으로 평가하고 술어가 TRUE로 평가하는 노드 만 선택합니다. 그림 1에서 [@id * -1
Logic bug. For the test input in Figure 1, systems like Saxon and eXist-DB both returned a result set with three Book nodes, while BaseX returned an empty result set. The difference between the processors indicates a potential bug. Based on our manual analysis, we suspected that BaseX computed an incorrect result, which is why we reported it to the BaseX developers. They fixed the bug quickly. The reason for this bug was an incorrect simplification of the arithmetic expression x * a > b to x > b / a. When the divisor is a negative number, the original operator > should be reversed to <. wp_automatic_readability="36.400054318305">
XPath standard. There are majorly two different standards of XPath implementations in use today, which we need to consider in our work. The XPath 1.0 standard was the first version. As a superset of XPath 1.0, the XPath 3.0 standard is the latest standard of the XPath language and provides more functionalities such as advanced data types and functions [5]. XPath 쿼리를 지원하는 대부분의 멀티 모델 DBMSS는 XPath 1.0 만 지원합니다. [1] (예 : Oracle, MySQL 및 PostgreSQL). 일부 전문화 된 XML 프로세서는 XPath 1.0 (예 : Libxml2) 만 지원하지만 다른 XPATH 3.0 표준 (예 : Basex, Evention-DB 및 Saxon)을 지원합니다.
XPath 버전 및 차동 테스트. 동일한 쿼리는 다른 표준에 따라 다른 결과를 생성 할 수 있습니다. 예를 들어, XPath 표현 책/@name = false ()의 경우 XPath 1.0 표준에 따라 표현식이 true를 반환 할 것으로 예상됩니다. @Name은 처음에 동등한 부울 가치로 캐스트됩니다. 현재 경우에는 이름 속성이 없으므로 빈 노드 세트가 반환됩니다. 동등한 부울 값은 빈 노드의 경우 False로 평가됩니다. 거짓과 거짓을 비교하는 것은 동일하므로 참이 반환됩니다. 그러나 XPath 3.0 표준에 따라 결과는 거짓일 것으로 예상됩니다. @Name은 빈 시퀀스를 반환하고 빈 시퀀스와 부울 값 사이의 평등 비교를 반환합니다. 따라서 다른 표준을 지원하는 XML 프로세서에 차등 테스트를 적용하는 것은 불가능합니다.
[2]
저자 :
(1) Shuxin Li, Southern Science and Technology China 및 National University of Singapore에서 인턴쉽을하는 동안 작업을 수행했습니다.[email protected]);
(2) 싱가포르 국립 대학교 싱가포르 마누엘 리거 (Manuel Rigger) ([email protected]).
Post Comment