[cxml-devel] Possible bug in cxml-stp
David Lichteblau
david at lichteblau.com
Tue May 22 13:35:30 UTC 2012
Quoting Raymond Wiker (rwiker at gmail.com):
> I was confused about empty namespace uris vs empty namespace tags - I
> wanted to create nodes that would be in the same namespace as their parent,
> but I now see why that would be problematic.
>
> Thank you for your patience.
So STP doesn't have a built-in feature for this, but I suppose a helper
function could be nice for this purpose. Maybe something like this:
CL-USER> (defun make-element-in-context (qname context)
(stp:make-element
qname
(stp:find-namespace (cxml::split-qname qname) context)))
MAKE-ELEMENT-IN-CONTEXT
CL-USER> (stp:make-element "test" "http://bar")
#.(CXML-STP:ELEMENT :LOCAL-NAME "test" :NAMESPACE-URI "http://bar")
CL-USER> (make-element-in-context "child" *)
#.(CXML-STP:ELEMENT :LOCAL-NAME "child" :NAMESPACE-URI "http://bar")
d.
More information about the cxml-devel
mailing list