unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] doc: Mention how to remove namespaces in xml->sxml.
@ 2024-07-23  0:02 Richard Sent
  2024-07-23  6:24 ` Dr. Arne Babenhauserheide
  2024-07-23  8:29 ` Maxime Devos
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Sent @ 2024-07-23  0:02 UTC (permalink / raw)
  To: guile-devel; +Cc: Richard Sent

This documents behavior discussed in
https://lists.gnu.org/archive/html/guile-user/2024-07/msg00013.html.

* doc/ref/sxml.texi (Reading and Writing XML): Document behavior of #f
namespace prefix.
---
 doc/ref/sxml.texi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/ref/sxml.texi b/doc/ref/sxml.texi
index 003309d54..ab0b010d0 100644
--- a/doc/ref/sxml.texi
+++ b/doc/ref/sxml.texi
@@ -91,7 +91,8 @@ All namespaces in the XML document must be declared, via @code{xmlns}
 attributes.  SXML elements built from non-default namespaces will have
 their tags prefixed with their URI.  Users can specify custom prefixes
 for certain namespaces with the @code{#:namespaces} keyword argument to
-@code{xml->sxml}.
+@code{xml->sxml}.  A namespace can be removed by using a @code{#f} custom
+prefix.
 
 @example
 (xml->sxml "<foo xmlns=\"http://example.org/ns1\">text</foo>")
-- 
2.45.2




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] doc: Mention how to remove namespaces in xml->sxml.
  2024-07-23  0:02 [PATCH] doc: Mention how to remove namespaces in xml->sxml Richard Sent
@ 2024-07-23  6:24 ` Dr. Arne Babenhauserheide
  2024-07-23  8:29 ` Maxime Devos
  1 sibling, 0 replies; 4+ messages in thread
From: Dr. Arne Babenhauserheide @ 2024-07-23  6:24 UTC (permalink / raw)
  To: Richard Sent; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

Richard Sent <richard@freakingpenguin.com> writes:

> This documents behavior discussed in
> https://lists.gnu.org/archive/html/guile-user/2024-07/msg00013.html.
>
> * doc/ref/sxml.texi (Reading and Writing XML): Document behavior of #f
> namespace prefix.
> ---
>  doc/ref/sxml.texi | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/doc/ref/sxml.texi b/doc/ref/sxml.texi
> index 003309d54..ab0b010d0 100644
> --- a/doc/ref/sxml.texi
> +++ b/doc/ref/sxml.texi
> @@ -91,7 +91,8 @@ All namespaces in the XML document must be declared, via @code{xmlns}
>  attributes.  SXML elements built from non-default namespaces will have
>  their tags prefixed with their URI.  Users can specify custom prefixes
>  for certain namespaces with the @code{#:namespaces} keyword argument to
> -@code{xml->sxml}.
> +@code{xml->sxml}.  A namespace can be removed by using a @code{#f} custom
> +prefix.
>  
>  @example
>  (xml->sxml "<foo xmlns=\"http://example.org/ns1\">text</foo>")

Looks good to me.

I moved the explanation below the list of changes and pushed the change
into main.

Thank you!

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] doc: Mention how to remove namespaces in xml->sxml.
  2024-07-23  0:02 [PATCH] doc: Mention how to remove namespaces in xml->sxml Richard Sent
  2024-07-23  6:24 ` Dr. Arne Babenhauserheide
@ 2024-07-23  8:29 ` Maxime Devos
  2024-07-23 14:57   ` Dr. Arne Babenhauserheide
  1 sibling, 1 reply; 4+ messages in thread
From: Maxime Devos @ 2024-07-23  8:29 UTC (permalink / raw)
  To: Richard Sent, guile-devel@gnu.org; +Cc: Richard Sent

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

>+@code{xml->sxml}.  A namespace can be removed by using a @code{#f} custom
>+prefix.
 >
> @example
> (xml->sxml "<foo xmlns=\"http://example.org/ns1\">text</foo>")

If you remove a single namespace, apparently that’s true, but what if multiple namespaces are removed? Does it still work then?

(I can imagine that somewhere the SXML code assumes a unique ‘namespace symbol/#f’ -> ‘namespace URL’ mapping.)

Best regards,
Maxime Devos.

[-- Attachment #2: Type: text/html, Size: 1788 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] doc: Mention how to remove namespaces in xml->sxml.
  2024-07-23  8:29 ` Maxime Devos
@ 2024-07-23 14:57   ` Dr. Arne Babenhauserheide
  0 siblings, 0 replies; 4+ messages in thread
From: Dr. Arne Babenhauserheide @ 2024-07-23 14:57 UTC (permalink / raw)
  To: Maxime Devos; +Cc: Richard Sent, guile-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

Maxime Devos <maximedevos@telenet.be> writes:

>> (xml->sxml "<foo xmlns=\"http://example.org/ns1\">text</foo>")
> If you remove a single namespace, apparently that’s true, but what if multiple namespaces are removed? Does it still work then?

Yes, it still works:

(import (sxml simple))
(define xml-string "<mus  xmlns=\"http://foobar\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" alttext=\"\\frac{1}{2}\" display=\"block\"><a /></math><b /></mus>")
(xml->sxml xml-string #:namespaces  '((#f . "http://www.w3.org/1998/Math/MathML")))
;; (*TOP* (http://foobar:mus (math (@ (display "block") (alttext "\\frac{1}{2}")) (a)) (http://foobar:b)))
(xml->sxml xml-string #:namespaces  '((#f . "http://foobar") (#f . "http://www.w3.org/1998/Math/MathML")))
;; (*TOP* (mus (math (@ (display "block") (alttext "\\frac{1}{2}")) (a)) (b)))

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-23 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-23  0:02 [PATCH] doc: Mention how to remove namespaces in xml->sxml Richard Sent
2024-07-23  6:24 ` Dr. Arne Babenhauserheide
2024-07-23  8:29 ` Maxime Devos
2024-07-23 14:57   ` Dr. Arne Babenhauserheide

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).