一个没有样板文件的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第三方库


热门话题
maven字段#getGenericType()抛出java。lang.TypeNotPresentException   用java绘制三角形的几何图形   java无法下载主题和发件人地址(rediff)   java如何使代码线程安全   java在尝试转换FileInputStream中的文件时,我遇到了一个FileNotFound异常   java Moxy和Jackson如何将Json映射到Pojo   在foreach循环中使用BufferedWriter生成新行的java问题   java为什么我的测试在单次执行中运行时间小于1秒,而在maven构建中运行时间大于20秒?   java如何显示下载附件的进度条   了解java rmi的良好实践   .net可以将Java portlet嵌入ASP。网页?   循环如何多次执行Java方法?   java如何确保用户输入在给定的有效范围内?   java单元测试定理   java如何在IntelliJ上运行外部构建项目?   JAVA:试图编写一个检查字符串是否为数字的方法。总是返回错误   javahadoop将特定键的所有map方法生成的所有值都发送到一个reduce方法,对吗?   在java中读取和使用文件