From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jan Synacek Newsgroups: gmane.lisp.guile.bugs Subject: bug#41320: sxml attributes of some elements are in reverse order Date: Sat, 16 May 2020 12:29:54 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="1062"; mail-complaints-to="usenet@ciao.gmane.io" To: 41320@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat May 16 12:31:16 2020 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZu68-00006d-13 for guile-bugs@m.gmane-mx.org; Sat, 16 May 2020 12:31:16 +0200 Original-Received: from localhost ([::1]:41538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZu67-0003IT-38 for guile-bugs@m.gmane-mx.org; Sat, 16 May 2020 06:31:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZu5v-0003HT-1t for bug-guile@gnu.org; Sat, 16 May 2020 06:31:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZu5u-00082g-O8 for bug-guile@gnu.org; Sat, 16 May 2020 06:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZu5u-0006SS-Ls for bug-guile@gnu.org; Sat, 16 May 2020 06:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jan Synacek Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 16 May 2020 10:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41320 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.158962500824743 (code B ref -1); Sat, 16 May 2020 10:31:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 May 2020 10:30:08 +0000 Original-Received: from localhost ([127.0.0.1]:39824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZu52-0006R1-Jp for submit@debbugs.gnu.org; Sat, 16 May 2020 06:30:08 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:38900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZu50-0006QD-HX for submit@debbugs.gnu.org; Sat, 16 May 2020 06:30:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZu4z-0002T2-S9 for bug-guile@gnu.org; Sat, 16 May 2020 06:30:06 -0400 Original-Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43441 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jZu4y-0007Yz-Go for bug-guile@gnu.org; Sat, 16 May 2020 06:30:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589625003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=8919fE3sCD8Enb931OQOIpbo5mDh/V366GtS5YlNpo0=; b=XXa2D6fTu+Oltux98kShOmTW1obAmPMsKZBSiGvzbMVH+TgYCu2iJMD39ihaXIWDc167/E 8QppgNa1b0Ruv+rOA7zI7s6nT/k/SWGQLatbCXQg3f/3Ky0ZH7ucIZXrFNoYGc4wOmobKQ h5OXMh9iohLlbPbxOC+t/SHEMEAg1JY= Original-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-gpEjaAbsMquHpaIiuZRGfg-1; Sat, 16 May 2020 06:29:57 -0400 X-MC-Unique: gpEjaAbsMquHpaIiuZRGfg-1 Original-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0DECA107ACCA for ; Sat, 16 May 2020 10:29:57 +0000 (UTC) Original-Received: from jsynacek-ntb.brq.redhat.com (unknown [10.40.192.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D3B7100239A for ; Sat, 16 May 2020 10:29:56 +0000 (UTC) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=jsynacek@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/16 05:35:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:9758 Archived-At: Consider the following code snippet running on Guile-3.0.2: (use-modules (sxml simple) (sxml xpath)) (define doc (call-with-input-file "/home/jsynacek/src/xcb-proto-1.13/src/xproto.xml" (lambda (port) (xml->sxml port)))) (define events ((sxpath '(// event)) doc)) (display (car events)) (newline) Now, attributes of *some* elements are generated in reverse order, which makes the output pretty much undeterministic and using sxml-match unreliable. This is from the original xml: ... And the resulting sxml: (event (@ (number 2) (name KeyPress)) (field (@ (type KEYCODE) (name detail))) (field (@ (type TIMESTAMP) (name time))) (field (@ (type WINDOW) (name root))) ... Attributes 'number' and 'name' are in reverse compared to the original xml. On the other hand, 'type' and 'name' of the 'field' element are in correct order. The xproto.xml file comes from xcb-proto [1]. [1] https://lists.freedesktop.org/archives/xcb/2018-March/011090.html