一个没有样板文件的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如何在sqlite数据库中保存特定列的历史记录   java如何更改/更新timeseriechart名称(JFreeChart)   java如何将整数转换为可绘制的   汇编什么解释Java的字节码   java查找已编译的类版本号   我应该什么时候在ColdFusion应用程序中使用Java?   java当一个实体的两个字段为(unique=true)时,如何处理JPA异常?   java为什么在所有其他实例都正确的情况下返回错误的布尔值?   java Hibernate每次都准备语句   java停留在平均字长上   对Java和日语字符进行编码   java如何将导致异常的方法的错误消息传递给侦听器中的onTestFailure方法   java代码没有打印结果   java为什么私有内部接口的方法必须是公共的?   休眠发生错误。有关详细信息,请参阅错误日志。JAVAlang.NullPointerException