Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change "xmlns" attribute in cxml dom transform #25

Merged
merged 1 commit into from Mar 21, 2019

Conversation

Projects
None yet
2 participants
@kisp
Copy link
Contributor

kisp commented Feb 20, 2019

Hi,

I am using the html5-parser for parsing and then I want to work with cxml-stp.

The form I use for conversion is

(dom:map-document (cxml-stp:make-builder)
                  (html5-parser:parse-html5 *html* :dom :cxml))

This used to work 2 years ago, but now I get the following error.

attempt to represent a namespace declaration as an ATTRIBUTE
   [Condition of type CXML-STP:STP-ERROR]

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

Backtrace:
  0: (CXML-STP:STP-ERROR "attempt to represent a namespace declaration as an ATTRIBUTE")
  1: ((:METHOD (SETF CXML-STP:LOCAL-NAME) (T CXML-STP:ATTRIBUTE)) "xmlns" #<error printing ATTRIBUTE {1002926473}>) [fast-method]
  2: (CXML-STP:MAKE-ATTRIBUTE "http://www.w3.org/1999/xhtml" "xmlns" NIL)
  3: ((:METHOD SAX:START-ELEMENT (CXML-STP-IMPL::BUILDER T T T T)) #<CXML-STP-IMPL::BUILDER {10028AE2F3}> "http://www.w3.org/1999/xhtml" #<unused argument> "html" (#S(SAX::STANDARD-ATTRIBUTE :NAMESPACE-URI..
  4: (SB-DEBUG::TRACE-CALL #<SB-DEBUG::TRACE-INFO SAX:START-ELEMENT> #<CLOSURE (LAMBDA (SB-PCL::.ARG0. SB-PCL::.ARG1. SB-PCL::.ARG2. SB-PCL::.ARG3. SB-PCL::.ARG4.) :IN "SYS:SRC;PCL;DLISP3.LISP") {10027B735..
  5: ((LAMBDA (CXML::CHILD) :IN DOM:MAP-DOCUMENT) #<RUNE-DOM::ELEMENT html {10029219D3}>)
  6: (DOM:MAP-NODE-LIST #<CLOSURE (LAMBDA (CXML::CHILD) :IN DOM:MAP-DOCUMENT) {1002922A7B}> #(#<RUNE-DOM::ELEMENT html {10029219D3}>))
  7: ((LABELS CXML::WALK :IN DOM:MAP-DOCUMENT) #<RUNE-DOM::DOCUMENT {1002921913}>)
  8: (DOM:MAP-DOCUMENT #<CXML-STP-IMPL::BUILDER {10028AE2F3}> #<RUNE-DOM::DOCUMENT {1002921913}> :INCLUDE-XMLNS-ATTRIBUTES NIL :INCLUDE-DOCTYPE NIL :INCLUDE-DEFAULT-VALUES NIL :RECODE #<unused argument>)

The attached patch fixes that.

Change "xmlns" attribute in cxml dom transform
When transforming to cxml dom, create the attribute "xmlns"
in namespace http://www.w3.org/2000/xmlns/.

@bakketun bakketun merged commit 74a92eb into rotatef:master Mar 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.