mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
doc: Add explanation on how to avoid escaping in SXML
* doc/ref/sxml.texi (Reading and Writing XML): Add explanation on using a procedure to avoid escaping. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
d987e7e7cb
commit
c9d0a0c48c
1 changed files with 15 additions and 0 deletions
|
@ -204,6 +204,21 @@ the current output port, unless the optional argument @var{port} is
|
|||
present.
|
||||
@end deffn
|
||||
|
||||
Output is automatically escaped as expected for a serializer.
|
||||
|
||||
@example
|
||||
(sxml->xml `(code "<i>Some example</i>"))
|
||||
@result{} <code><i>Some example</i></code>
|
||||
@end example
|
||||
|
||||
In order to avoid some string from being escaped, it must be wrapped in a
|
||||
procedure that writes the string to the @code{(current-output-port)}.
|
||||
|
||||
@example
|
||||
(sxml->xml `(code ,(lambda () (display "<i>Some example</i>"))))
|
||||
@result{} <code><i>Some example</i></code>
|
||||
@end example
|
||||
|
||||
@deffn {Scheme Procedure} sxml->string sxml
|
||||
Detag an sxml tree @var{sxml} into a string. Does not perform any
|
||||
formatting.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue