How to convert XML namespaces to Clojure namespaces during XML parse?

浪尽此生 提交于 2019-12-23 01:34:36

问题


How to convert XML namespaces to Clojure namespaces during parse? For example with clojure.data.zip.xml lib.

Is it possible by connecting external parser though?

For example, we have XSD file with a number of declared namespaces inside schema tag and some of them are used in definition below

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by Fujitsu Interstage XWand B0237 -->
<xsd:schema targetNamespace="http://www.cbr.ru/xbrl/bfo/rep/2017-10-31/tab/FR_1_001_01c_01"
            elementFormDefault="qualified"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:FR_1_001_01c_01="http://www.cbr.ru/xbrl/bfo/rep/2017-10-31/tab/FR_1_001_01c_01"
            xmlns:model="http://www.eurofiling.info/xbrl/ext/model"
            xmlns:ifrs-full="http://xbrl.ifrs.org/taxonomy/2015-03-11/ifrs-full"
            xmlns:label="http://xbrl.org/2008/label"
            xmlns:ca="http://xbrl.org/2008/assertion/consistency"
            xmlns:rol_ifric_2_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_ifric_2_2015-03-11"
            xmlns:rol_sic_27_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_sic_27_2015-03-11"
            xmlns:rol_ias_7_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_ias_7_2015-03-11"
            xmlns:va="http://xbrl.org/2008/assertion/value"
            xmlns:xfi="http://www.xbrl.org/2008/function/instance"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:mf="http://xbrl.org/2008/filter/match"
            xmlns:rol_ias_10_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_ias_10_2015-03-11"
            xmlns:rol_ias_27_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_ias_27_2015-03-11"
            xmlns:rol_ifrs_13_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_ifrs_13_2015-03-11"
            xmlns:rol_ifrs_8_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_ifrs_8_2015-03-11"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            xmlns:ea="http://xbrl.org/2008/assertion/existence"
            xmlns:rol_ifrs_4_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_ifrs_4_2015-03-11"
            xmlns:ref="http://www.xbrl.org/2006/ref"
            xmlns:bf="http://xbrl.org/2008/filter/boolean"
            xmlns:fn="http://www.w3.org/2005/xpath-functions"
            xmlns:rol_ias_19_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_ias_19_2015-03-11"
            xmlns:msg="http://xbrl.org/2010/message"
            xmlns:gen="http://xbrl.org/2008/generic"
            xmlns:rol_ias_23_2015-03-11="http://xbrl.ifrs.org/role/ifrs/rol_ias_23_2015-03-11"
            xmlns:num="http://www.xbrl.org/dtr/type/numeric"
            xmlns:pf="http://xbrl.org/2007/filter/period"

So I would like to create correspondent namespaces for clojure keyword in map representing data parsed from XML files according to this XSD.

来源:https://stackoverflow.com/questions/48992173/how-to-convert-xml-namespaces-to-clojure-namespaces-during-xml-parse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!