On Aug 24, 2013, at 5:25 PM, Jim Ursetto <zbignie...@gmail.com> wrote:
> Unfortunately it doesn't declare the default namespace for html. You can > work around this by providing a default namespace prefix *and* using the > actual prefix (below, xhtml:) on your elements. This is kind of ugly. > However, the stock serializer didn't even support default namespaces (!) so I > may have simply overlooked this case when adding support. I'll see if I can > look into it further. I've added support for the default (unqualified) namespace ID in the source SXML now; the code is available at https://github.com/ursetto/sxml-serializer while I run a couple more tests. Formerly, you could render to unqualified names but not use them properly in the source. [Note: below, unqualified names are rendering to the xhtml: namespace, because there is a list of default namespace URI -> ID mappings, called conventional-ns-prefixes. To override this and render them without qualification, add *default* as the 3rd arg of the namespace association (as the "original prefix"). The word "original" is used as if the XML document was the original source and you had parsed it to SXML; the SXML prefix and XML prefix are permitted to differ.] (use sxml-serializer) (print (serialize-sxml '(*TOP* (@ (*NAMESPACES* (*default* "http://www.w3.org/1999/xhtml") (cvt "http://xmlns.therebetygers.net/civet/0.1"))) (*PI* xml "version=\"1.0\" encoding=\"utf-8\"") (html (@ (xml:lang "en") (lang "en")) (cvt:template (cvt:head (cvt:locale (@ (lang "en") (country "US") (encoding "utf-8")))) (cvt:block (@ (name "headerContent")) #\< Single #\space (#\a #\r #\t #\i #\c #\l #\e) #\space "page>")))) )) <?xml version="1.0" encoding="utf-8"?> <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <cvt:template xmlns:cvt="http://xmlns.therebetygers.net/civet/0.1"> <cvt:head> <cvt:locale lang="en" country="US" encoding="utf-8" /> </cvt:head> <cvt:block name="headerContent"><Single article page></cvt:block> </cvt:template> </xhtml:html> _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users