[cxml-devel] normalize-text-nodes!

Andy Chambers achambers.home at gmail.com
Sat May 29 13:44:08 UTC 2010


Hi,

Using xuriella to perform the identity transform fails when there are empty
elements (e.g. "<BasicDefinitions/>") in the source document.  I believe the
problem is in normalize-text-nodes! which doesn't check to see if there are
any children before trying to iterate over them.  This seems to trigger an
assertion error in sbcl.

XURIELLA> (apply-stylesheet #p"/usr/src/discworld/xslt/identity.xsl"
"<root>abc</root>")
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<root>abc</root>"
XURIELLA> (apply-stylesheet #p"/usr/src/discworld/xslt/identity.xsl"
"<root></root>")
The value NIL is not of type VECTOR.
   [Condition of type TYPE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [ABORT] Return to SLIME's top level.
 2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" RUNNING
{CA2E459}>)

Backtrace:
  0: (CXML-STP-IMPL::NORMALIZE-TEXT-NODES! #.(CXML-STP:ELEMENT #| :PARENT of
type DOCUMENT |# :LOCAL-NAME "root"))
  1: ((SB-PCL::FAST-METHOD XPATH-PROTOCOL:CHILD-PIPE-USING-NAVIGATOR ((EQL
:DEFAULT-NAVIGATOR) CXML-STP:ELEMENT)) ..)
  2: ((LAMBDA (XPATH::NODE XPATH::STARTING-NODE)) #.(CXML-STP:ELEMENT #|
:PARENT of type DOCUMENT |# :LOCAL-NAME "root") #.(CXML-STP:ELEMENT #|
:PARENT of type DOCUMENT |# :LOCAL-NAME "root"))
  3: ((LAMBDA (XPATH:CONTEXT)) #<XPATH:CONTEXT {C750F39}>)


Simple fix is attached.

Cheers,
Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cxml-devel/attachments/20100529/25fb178c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check-for-presence-of-kids.patch
Type: text/x-patch
Size: 727 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cxml-devel/attachments/20100529/25fb178c/attachment.bin>


More information about the cxml-devel mailing list