From: Mirko on
Hello,

I need to generate xml tags of the following type:

<diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">

i.e. with the xmlns namespace. Which library can do that (cl-who does
not seem to be able to)?

Thanks,

Mirko
From: Pascal J. Bourguignon on
Mirko <mirko.vukovic(a)gmail.com> writes:

> Hello,
>
> I need to generate xml tags of the following type:
>
> <diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
>
> i.e. with the xmlns namespace. Which library can do that (cl-who does
> not seem to be able to)?


xmls can generate XML with namespaces:

(xmls:toxml '("diagram" (("xmlns:dia" "http://www.lysator.liu.se/~alla/dia/"))))
--> "<diagram xmlns:dia=\"http://www.lysator.liu.se/~alla/dia/\"/>"

It ignores them when parsing, but I guess this is something that could
easily be modified.

--
__Pascal Bourguignon__ http://www.informatimago.com/
From: Olof-Joachim Frahm on
Hi Mirko,

you can actually do that with CL-WHO: by using the following syntax for
the attribute:
> (cl-who:with-html-output (*standard-output* NIL)
> (:diagram :|xmlns:dia| "http://www.lysator.liu.se/~alla/dia/"))
or (because I also looked for this feature) by hacking CL-WHO to use
for example the following cons syntax, which to my knowledge isn't used
for anything in the unpatched library:
> (cl-who:with-html-output (*standard-output*)
> (:diagram (:xmlns . :dia) "http://www.lysator.liu.se/~alla/dia/"))

If that suits you, the fork and a bit of documentation is available from
<http://github.com/Ferada/cl-who>.

Cheers,
Olof

--
The world is burning. Run.
From: Frode V. Fjeld on
Mirko <mirko.vukovic(a)gmail.com> writes:

> I need to generate xml tags of the following type:
>
> <diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
>
> i.e. with the xmlns namespace. Which library can do that (cl-who does
> not seem to be able to)?

I just got around to upload this library which perhaps does what you
need: http://github.com/frodef/pithy-xml

Here's an intro session:

PITHY-XML> (define-xml-namespace dia "http://www.lysator.liu.se/~alla/dia/")
DIA
PITHY-XML> (read-xml "<diagram xmlns:dia='http://www.lysator.liu.se/~alla/dia/' />")
(:DIAGRAM XMLNS::DIA "http://www.lysator.liu.se/~alla/dia/")
PITHY-XML> (print-xml *)
"<Diagram xmlns:dia='http://www.lysator.liu.se/~alla/dia/'/>"
PITHY-XML>

--
Frode V. Fjeld

From: Mirko on
On Jul 1, 7:14 am, "Frode V. Fjeld" <fro...(a)cs.uit.no> wrote:
> Mirko <mirko.vuko...(a)gmail.com> writes:
> > I need to generate xml tags of the following type:
>
> > <diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
>
> > i.e. with the xmlns namespace.  Which library can do that (cl-who does
> > not seem to be able to)?
>
> I just got around to upload this library which perhaps does what you
> need:http://github.com/frodef/pithy-xml
>
> Here's an intro session:
>
> PITHY-XML> (define-xml-namespace dia "http://www.lysator.liu.se/~alla/dia/")
> DIA
> PITHY-XML> (read-xml "<diagram xmlns:dia='http://www.lysator.liu.se/~alla/dia/'/>")
> (:DIAGRAM XMLNS::DIA "http://www.lysator.liu.se/~alla/dia/")
> PITHY-XML> (print-xml *)
> "<Diagram xmlns:dia='http://www.lysator.liu.se/~alla/dia/'/>"
> PITHY-XML>
>
> --
> Frode V. Fjeld

Thanks. I am right now using xmls, but will take a look at this
package.

Mirko