unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Alexandros Theodotou <alex@zrythm.org>
To: guile-devel@gnu.org
Cc: Alexandros Theodotou <alex@zrythm.org>
Subject: [PATCH] Add sxml->xml example code in docs.
Date: Sat, 12 Feb 2022 22:32:04 +0000	[thread overview]
Message-ID: <20220212223204.410468-1-alex@zrythm.org> (raw)

* doc/ref/sxml.texi (Reading and Writing XML): Add sxml->xml example
  code.
---
 doc/ref/sxml.texi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/doc/ref/sxml.texi b/doc/ref/sxml.texi
index 5f827916e..efd086be3 100644
--- a/doc/ref/sxml.texi
+++ b/doc/ref/sxml.texi
@@ -201,6 +201,17 @@ example to validate the parsed SXML against the doctype.
 Serialize the SXML tree @var{tree} as XML. The output will be written to
 the current output port, unless the optional argument @var{port} is
 present.
+
+@example
+(sxml->xml
+ `(*TOP*
+    (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")
+    (component
+      (@ (url "https://www.gnu.org/software/guile/")
+         (type "software"))
+      (name "GNU Guile"))))
+@result{} <?xml version="1.0" encoding="UTF-8"?><component url="https://www.gnu.org/software/guile/" type="software"><name>GNU Guile</name></component>
+@end example
 @end deffn
 
 @deffn {Scheme Procedure} sxml->string sxml
-- 
2.35.1




                 reply	other threads:[~2022-02-12 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220212223204.410468-1-alex@zrythm.org \
    --to=alex@zrythm.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).