Hi,
I am trying to parse an xpdl file. The problem for me is, that every tag
is prefixed with xpdl namespace. The lookup from clojure.data.zip.xml
always returns nil.
(the same code works for non-prefixed XMLs)
zipper:
[{:tag :xpdl:Package,
:attrs
{:xmlns:xpdl "http://www.wfmc.org/2008/XPDL2.1",
:xmlns "http://www.wfmc.org/2008/XPDL2.1",
:xmlns:xsi "http://www.w3.org/2001/XMLSchema-instance",
:Id "testPackage",
:Name "Test-Package",
:xsi:schemaLocation
"http://www.wfmc.org/2008/XPDL2.1
http://www.wfmc.org/standards/docs/bpmnxpdl_31.xsd"},
...
code:
(ns test.core
(:require [clojure.zip :as zip]
[clojure.xml :as xml]
[clojure.data.zip.xml :as cdzip]))
(def zipper (zip/xml-zip (xml/parse "res/testPackage.xpdl")))
(cdzip/xml-> zipper :xpdl:Package)
returns nil
(cdzip/xml-> zipper (keyword "xpdl:Package"))
also returns nil
Does anybody know how to handle lookups in such XMLs?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en