[cxml-devel] Real-world Example

Steven Nunez steve_nunez at yahoo.com
Mon Jun 11 02:46:23 UTC 2012


Greetings again,

Perhaps a good example would be a real one. I'm starting with some simple functions, such as obtaining the model name, algorithm, etc, from the attached XML example. Can anyone provide an exemplary method for doing this? Below is my naive attempt, which are all failing miserably:

(defun algorithm-name (model)
  "Returns the algorithm for the model"
  (stp:filter-recursively (stp:of-name "algorithmName" (stp:namespace-uri model)) model))

I know this one will (if it were working) return a list, but since I can't get past the namespace problem haven't bothered to go any further. That function, I assume, is a rather trivial one for someone with some good examples or knowledge to work from. Here's a slightly more difficult function:

(defun model-coefficient-list (model)
  "Returns a nested list of the following structure: (<model-name>-coefficients (coefficient1 coefficient1-value) (coefficient1 coefficient2-value) ... (coefficientn coefficientn-value))"
  ...)

Something like this would be good to put on the STP website.

Regards,
- Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cxml-devel/attachments/20120610/11d02f31/attachment.html>


More information about the cxml-devel mailing list