一个没有样板文件的XML转换框架。

inxs的Python项目详细描述


inxs–一个用于xml转换的python框架,没有样板文件。

inxs是不可分割的。

inxs不是xslt。

inxs是isc许可的。

inxs在这里有完整的文档:https://inxs.readthedocs.io/en/latest/

https://img.shields.io/pypi/v/inxs.svghttps://img.shields.io/pypi/l/inxs.svghttps://img.shields.io/pypi/pyversions/inxs.svghttps://img.shields.io/travis/funkyfuture/inxs/master.svghttps://coveralls.io/repos/github/funkyfuture/inxs/badge.svg

一瞥

求解Wikipedia XSLT example #1

defextract_person(node:TagNode):returnnode.attributes['username'],first(node.css_select("name")).full_textdefappend_person(previous_result,result:TagNode):result.append_child(result.new_tag_node("name",attributes={"username":previous_result[0]},children=[previous_result[1]]))transformation=Transformation(Rule('person',(extract_person,append_person)),result_object='context.result',context={'result':new_tag_node('root')})# that's four lines less LOC than the XSLT implementation

求解Wikipedia XSLT example #2

defgenerate_skeleton(context):context.html=new_tag_node("html",namespace='http://www.w3.org/1999/xhtml',children=(tag("head",tag("title","Testing XML Example")),tag("body",(tag("h1","Persons"),tag("ul"))),))defextract_person(node:TagNode,persons):persons.append((first(node.css_select("name")).full_text,first(node.css_select("family-name")).full_text))deflist_persons(previous_result,html:TagNode):first(html.css_select("html|body html|ul")).append_child(*(html.new_tag_node("li",children=[f'{x[1]}, {x[0]}'])forxinprevious_result))transformation=Transformation(generate_skeleton,Rule('person',extract_person),lib.sort('persons',itemgetter(1)),list_persons,result_object='context.html',context={'persons':[]})# that's four lines more LOC than the XSLT implementation

Here您可以找到inxs的源存储库和问题跟踪程序。

历史记录

0.2b1(2019-06-23)

  • 重构为基于delb而不是lxml
  • 从处理程序函数的可用符号中删除了
    • tree
    • xpath_evaluator(改用root.xpath
  • 已重命名处理程序函数的可用符号:
    • element->;node
  • 在核心中重命名为
    • SkipToNextElement->;SkipToNextNode
  • 已从库中删除
    • drop_siblings
    • extract_text
    • has_tail
    • init_elementmaker
    • merge
    • replace_text
    • sub
  • 在库中重命名为
    • make_element->;make_node
    • remove_element->;remove_node
    • remove_elements->;remove_nodes
    • sorter->;sort
    • strip_attributes->;remove_attributes
    • strip_namespace->;remove_namespace

函数和方法的各种参数已相应地重命名。

0.1b1(2017-06-25)

  • new:允许任何规则在每次转换时都必须匹配的定义 common_rule_conditions
  • 小的改进和修正。

0.1b0(2017-06-19)

  • 第一个测试版。

0.1a0(2017-05-02)

  • pypi上的第一个版本。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Requestcontextholder在spring 4中具有并发访问权限。IBMWebSphere上的x Web应用程序?   java如何下载、设置和使用Eclipse?   java如何组合这些mysql语句   java JDBC无法连接到openshift上的mysql数据库   如果存在允许正确处理的重载,java对于方便的方法来说是否可行?   使用hibernate序列的java Spring MVC不存在   具有路径的java Selenium ChromeDriver负载扩展问题   读一本书。java中的java文件   退出队列时,Java队列程序结果为空   Java lambda返回带有重复代码问题的列表   java使用意图从其他活动传递数据并在listview中显示   java如何在java中创建JSON输出   java Android:在不破坏或暂停活动的情况下关闭显示   支持Android电视和手机的java多apk   关于Java应用程序测试和调试的一组问题   如何在JavaSE中使用jdbcRealmShiro进行授权   在java中是否有一个无异常检查的URL解析实用程序?   当页面上有多个相同类型的元素时,java会选择一个特定的元素   递归需要帮助发现java代码中的缺陷