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