1- % %%-------------------------------------------------------------------
2- % %% File : xpath_abbrev.erl
3- % %% Author : Bertil Karlsson <bertil@finrod>
4- % %% Description :
5- % %%
6- % %% Created : 17 Jan 2006 by Bertil Karlsson <bertil@finrod>
7- % %%-------------------------------------------------------------------
1+ % % %CopyrightBegin%
2+ % %
3+ % % SPDX-License-Identifier: Apache-2.0
4+ % %
5+ % % Copyright Ericsson AB 2026. All Rights Reserved.
6+ % %
7+ % % Licensed under the Apache License, Version 2.0 (the "License");
8+ % % you may not use this file except in compliance with the License.
9+ % % You may obtain a copy of the License at
10+ % %
11+ % % http://www.apache.org/licenses/LICENSE-2.0
12+ % %
13+ % % Unless required by applicable law or agreed to in writing, software
14+ % % distributed under the License is distributed on an "AS IS" BASIS,
15+ % % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+ % % See the License for the specific language governing permissions and
17+ % % limitations under the License.
18+ % %
19+ % % %CopyrightEnd%
20+
821-module (xpath_abbrev ).
922
1023-export ([test /0 , check_node_set /2 , ticket_6873 /0 , ticket_7496 /0 , functions /0 ]).
@@ -62,7 +75,7 @@ test() ->
6275 Res22 = xmerl_xpath :string (" blipp[@id and @test]" ,E ),
6376 ok = check_node_set (" blipp[@id and @test]" ,Res22 ).
6477
65- check_node_set (" blipp" ,[E1 ,E2 ,E3 ]) ->
78+ check_node_set (" blipp" ,[E1 ,E2 ,E3 ]) ->
6679 ok = xml_element_name (E1 ,blipp ),
6780 ok = xml_element_name (E2 ,blipp ),
6881 ok = xml_element_name (E3 ,blipp ),
@@ -107,7 +120,7 @@ check_node_set("/myBS_model/blipp[3]/blupp[2]",[E]) ->
107120 # xmlElement {name = blupp ,
108121 attributes = [# xmlAttribute {name = att ,value = " bluppc2" }]}= E ,
109122 ok ;
110- check_node_set (" blipp//plopp" ,[# xmlElement {name = plopp },# xmlElement {name = plopp }]) ->
123+ check_node_set (" blipp//plopp" ,[# xmlElement {name = plopp },# xmlElement {name = plopp }]) ->
111124 ok ;
112125check_node_set (" //plopp" ,[E1 ,E2 ,E3 ]) ->
113126 ok = xml_element_name (E1 ,plopp ),
@@ -247,7 +260,6 @@ relational_operators() ->
247260 ok = Test (Doc , " /a/*[3 > 2]" , All ),
248261 ok .
249262
250-
251263functions () ->
252264 Test = fun (Doc , XPath , Exp ) ->
253265 Result = xmerl_xpath :string (XPath , Doc ),
@@ -263,7 +275,7 @@ functions() ->
263275 end || Obj <- Result ],
264276 ok
265277 end ,
266- Foo =
278+ Foo =
267279 " <foo>"
268280 " <bar>"
269281 " <name>Xml</name>"
@@ -297,7 +309,6 @@ functions() ->
297309 ok = Test (Doc ," /foo[sum(bar/value) = 6]" ,[foo ]),
298310 ok = Test (Doc ," /foo/bar/value[number() = 2]" ,[value ]),
299311
300-
301312 {Doc2 ,_ }= xmerl_scan :file (" purchaseOrder.xml" ),
302313 ok = Test (Doc2 ," //*[starts-with(local-name(),'c')]" ,
303314 ['apo:comment' ,city ,city ,comment ]),
@@ -306,7 +317,6 @@ functions() ->
306317 ok = Test (Doc2 ," //*[starts-with(name(),'{http://www.example.com/PO1')]" ,
307318 ['apo:purchaseOrder' ,'apo:comment' ]).
308319
309-
310320namespaces () ->
311321 {Doc ,_ } = xmerl_scan :file (" purchaseOrder.xml" , [{namespace_conformant , true }]),
312322
0 commit comments