sharplispers / cxml Goto Github PK
View Code? Open in Web Editor NEWClosure XML - A Common Lisp XML Parser
Home Page: http://common-lisp.net/project/cxml/
License: Other
Closure XML - A Common Lisp XML Parser
Home Page: http://common-lisp.net/project/cxml/
License: Other
@ruricolist made his test suite available in a separate repository:
https://github.com/ruricolist/cxml-tests
I've made a separate repository for it because it's quite large (>30 Mb). You might decide (as I did) that keeping the test suite with the rest of the code is worth the extra size.
(The other advantage of a separate repository, of course, is that you can easily test against older versions of CXML.)
Originally posted by @ruricolist in #3 (comment)
I have noticed that cxml is looping for a certain combination of xml/dtd. It loops in the recurse function inside compile-content-model in xml-parse.lisp
. I have put a lot of time on trying to understand how the code is supposed to work but without success.
It would be great if someone knowing the code could have a look at this!
A minimal reproducible case is available here https://doremir.com/files/cxml/xml-test.zip.
The xml file from the case looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE a PUBLIC "" "">
<a>
<c/>
</a>
And the dtd file looks like this:
<!ELEMENT b EMPTY>
<!ELEMENT c EMPTY>
<!ELEMENT a ((b?)*, c?)>
The real world case is from parsing MusicXML and the problematic xml excerpt looks like this:
<sound tempo="90">
<offset sound="yes">8</offset>
</sound>
And the corresponding dtd excerpt looks like this:
<!ELEMENT sound ((midi-device?, midi-instrument?, play?)*, offset?)>
I'd like to propose switching CXML to use named-readtables. It would allow removing the component classes from the .asd file, moving it in a much more declarative direction.
This isn't technically challenging (I already did it for FXML) but it would require a coordinated change across closure-common and CXML so I wanted to raise it for discussion first.
You can see the contemplated changes in these commits:
Is it possible to call DOM's getBoundingClientRect()
on an Element which i get by:
(aref (dom:get-elements-by-tag-name
(cxml:parse-file "./test.svg" (cxml-dom:make-dom-builder))
"path") 0)
This returns a #<RUNE-DOM::ELEMENT path {10042A87A3}>
from the SVG file test.svg.
Lines 13 to 37 in adb4430
This codeblock contributes to (IMO unnecessarily) verbose Quicklisp loads of cxml, for instance:
To load "foo-system":
Load 1 ASDF system:
foo-system
; Loading "foo-system"
.
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
..
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
;;; Building Closure with CHARACTER RUNES
...............................................
...................
Is it possible/desired to remove the FORMAT
calls altogether?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.