transform 相关问题

协调和其他转换。您可能想要一个更具体的标签,如[css-transforms]。

如何在 Flutter 中将 Stream<List<int>> 转换为 Stream<Uint8List>

我有一个来自包的 Flutter 函数,它返回一个 Stream,我想转换/转换为一个 Stream。我对飞镖流不是很熟悉所以我会很感激任何帮助/建议......

回答 0 投票 0

有没有办法让 Pentaho 作业只获取新记录而不重新运行旧记录?

我有这个解析 JSON 数据的查询。我将查询添加到 Pentaho 转换中,运行 Pentaho 作业需要很长时间(大约 20 分钟),而且我们每天都有新的 ID 记录,所以我

回答 0 投票 0

参考Qt3D实体动画

我正在尝试为 Qt3D 实体制作动画,而不必在每次底层对象的值发生变化时调用 QTransform 设置器。 QTransform 将引用作为 setTranslation、setMatr 的参数...

回答 0 投票 0

将多列转换为宽格式

我有一个关于将数据转换为宽格式的最佳方法的问题,希望以一种可以理解的方式提出这个问题。考虑以下代码: 天<- c("mon", "tues&q...

回答 1 投票 0

如何让转换后的元素不被溢出自动切断?

我正在使用 Bootstrap 4 为朋友的个人网站制作模态画廊。我设置它以便图像在悬停时展开——但是当我设置

回答 1 投票 0

使用 JOLT 转换,我只需要从 JSON 有效负载中提取内容部分。需要 JOLT 规格

{ “片段格式”:“空片段”, “总数”:361, “开始”:1, “页面长度”:5, “选择”:“包括”, “结果”: [ { &

回答 0 投票 0

转换时如何从xml文件中排除一些命名空间

我是 XSL/XML 的新手,需要 XSL 转换方面的帮助。 在我的任务中,我需要将 UBL 文件转换为 PUF。 例如,我有这个 XML: 我是 XSL/XML 的新手,需要 XSL 转换方面的帮助。 在我的任务中,我需要将 UBL 文件转换为 PUF。 例如,我有这个 XML: <?xml version="1.0" encoding="UTF-8"?> <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"     xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"     xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">    <cbc:ID>TOSL108</cbc:ID>    <cbc:IssueDate>2011-09-22</cbc:IssueDate>    <cac:InvoicePeriod>       <cbc:StartDate>2011-08-01</cbc:StartDate>       <cbc:EndDate>2011-08-31</cbc:EndDate>    </cac:InvoicePeriod>    <cac:AccountingSupplierParty>       <cac:Party>          <cac:PartyName>             <cbc:Name>Custom Cotter Pins</cbc:Name>          </cac:PartyName>       </cac:Party>    </cac:AccountingSupplierParty>    <cac:AccountingCustomerParty>       <cac:Party>          <cac:PartyName>             <cbc:Name>North American Veeblefetzer</cbc:Name>          </cac:PartyName>       </cac:Party>    </cac:AccountingCustomerParty>    <cac:LegalMonetaryTotal>       <cbc:PayableAmount currencyID="CAD">100.00</cbc:PayableAmount>    </cac:LegalMonetaryTotal>    <cac:InvoiceLine>       <cbc:ID>1</cbc:ID>       <cbc:LineExtensionAmount currencyID="CAD">100.00</cbc:LineExtensionAmount>       <cac:Item>          <cbc:Description>Cotter pin, MIL-SPEC</cbc:Description>       </cac:Item>    </cac:InvoiceLine> </Invoice> 我需要在根元素中创建带有一些 pagero 命名空间的文件。 我的预期结果: <Invoice xmlns="urn:pagero:PageroUniversalFormat:Invoice:1.0"     xmlns:cac="urn:pagero:CommonAggregateComponents:1.0"     xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"     xmlns:puf="urn:pagero:ExtensionComponent:1.0"     xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">     <cbc:CustomizationID>urn:pagero.com:puf:billing:2.0</cbc:CustomizationID>     <cbc:ProfileID>urn:pagero.com:puf:billing:1.0</cbc:ProfileID>     <cbc:ID>TOSL108</cbc:ID>     <cbc:IssueDate>2011-09-22</cbc:IssueDate>     <cac:InvoicePeriod>         <cbc:StartDate>2011-08-01</cbc:StartDate>         <cbc:EndDate>2011-08-31</cbc:EndDate>     </cac:InvoicePeriod>     <cac:AccountingSupplierParty>         <cac:Party>             <cac:PartyName>                 <cbc:Name>Custom Cotter Pins</cbc:Name>             </cac:PartyName>         </cac:Party>     </cac:AccountingSupplierParty>     <cac:AccountingCustomerParty>         <cac:Party>             <cac:PartyName>                 <cbc:Name>North American Veeblefetzer</cbc:Name>             </cac:PartyName>         </cac:Party>     </cac:AccountingCustomerParty>     <cac:LegalMonetaryTotal>         <cbc:PayableAmount currencyID="CAD">100.00</cbc:PayableAmount>     </cac:LegalMonetaryTotal>     <cac:InvoiceLine>         <cbc:ID>1</cbc:ID>         <cbc:LineExtensionAmount currencyID="CAD">100.00</cbc:LineExtensionAmount>         <cac:Item>             <cbc:Description>Cotter pin, MIL-SPEC</cbc:Description>         </cac:Item>     </cac:InvoiceLine> </Invoice> 为此,我使用 XSL 模板,例如 UBLtoPUF.xsl。问题是,生成的文件如下所示: <Invoice xmlns="urn:pagero:PageroUniversalFormat:Invoice:1.0" xmlns:cac="urn:pagero:CommonAggregateComponents:1.0" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:puf="urn:pagero:ExtensionComponent:1.0" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"> <cbc:CustomizationID>urn:pagero.com:puf:billing:2.0</cbc:CustomizationID> <cbc:ProfileID>urn:pagero.com:puf:billing:1.0</cbc:ProfileID> <cbc:ID xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">TOSL108</cbc:ID> <cbc:IssueDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"> 2011-09-22</cbc:IssueDate> <cac:InvoicePeriod xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"> <cbc:StartDate>2011-08-01</cbc:StartDate> <cbc:EndDate>2011-08-31</cbc:EndDate> </cac:InvoicePeriod> <cac:AccountingSupplierParty xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"> <cac:Party> <cac:PartyName> <cbc:Name>Custom Cotter Pins</cbc:Name> </cac:PartyName> </cac:Party> </cac:AccountingSupplierParty> <cac:AccountingCustomerParty xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"> <cac:Party> <cac:PartyName> <cbc:Name>North American Veeblefetzer</cbc:Name> </cac:PartyName> </cac:Party> </cac:AccountingCustomerParty> <cac:LegalMonetaryTotal xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"> <cbc:PayableAmount currencyID="CAD">100.00</cbc:PayableAmount> </cac:LegalMonetaryTotal> <cac:InvoiceLine xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"> <cbc:ID>1</cbc:ID> <cbc:LineExtensionAmount currencyID="CAD">100.00</cbc:LineExtensionAmount> <cac:Item> <cbc:Description>Cotter pin, MIL-SPEC</cbc:Description> </cac:Item> </cac:InvoiceLine> </Invoice> xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" 命名空间出现在<Invoice> 子节点上。 这些名称空间仅通过直接/Invoice 子节点传播,但没有子节点的其他子节点等。 所以我正在(以某种方式)对所有孩子的孩子等做所有正确的事情,但不是对/Invoice.的直接孩子 有一个我用的模板: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:puf="urn:pagero:ExtensionComponent:1.0" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns="urn:pagero:PageroUniversalFormat:Invoice:1.0"> <xsl:output method="xml" indent="yes" /> <xsl:template match="/"> <Invoice xmlns:cac="urn:pagero:CommonAggregateComponents:1.0" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:puf="urn:pagero:ExtensionComponent:1.0" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"> <cbc:CustomizationID>urn:pagero.com:puf:billing:2.0</cbc:CustomizationID> <cbc:ProfileID>urn:pagero.com:puf:billing:1.0</cbc:ProfileID> <xsl:apply-templates select="//*[local-name() = 'Invoice']/*[not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2')]" /> </Invoice> </xsl:template> <xsl:template match="//*[local-name() = 'Invoice']/*[namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2']"> <xsl:element name="{name()}" namespace=""> <xsl:apply-templates select="node()/*[not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2')]" /> </xsl:element> </xsl:template> <!-- Suppress the UBLVersionID element --> <xsl:template match="//*[local-name() = 'UBLVersionID']" /> <!-- Copy attributes as-is, except for the namespace attributes --> <xsl:template match="@*[not(namespace-uri() = 'http://www.w3.org/2001/XMLSchema-instance')] [not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2')] [not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2')] [not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2')] [not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2')]"> <xsl:copy /> </xsl:template> <!-- Copy elements as-is --> <xsl:template match="node()"> <xsl:copy> <xsl:apply-templates select="@*[not(namespace-uri() = 'http://www.w3.org/2001/XMLSchema-instance')] [not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2')] [not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2')] [not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2')] [not(namespace-uri() = 'urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2')]" /> <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> </xsl:stylesheet> 我试图改变<xsl:template match="node()">但它没有帮助。我没有发现任何关于如何使用模板排除命名空间的问题。 请帮助我如何更改我的模板以摆脱 <Invoice> 子元素的命名空间? 您需要了解构造元素的命名空间规则。 首先记住数据模型是关于范围内命名空间的,而不是关于命名空间声明的。一个元素有一组在该元素范围内的名称空间绑定(前缀-uri 映射);名称空间是在该元素上还是在某个祖先上声明并不重要。因此,当它已经在 Invoice 元素上声明时,在样式表中的 xsl:stylesheet 元素上冗余声明命名空间是没有意义的。 当需要序列化结果树时,序列化程序将生成命名空间声明,以便声明结果树中元素上的所有in-scope命名空间(并且仅in-scope命名空间),从而消除冗余声明. 有三种创建元素的方法,它们对于新元素上将出现哪些范围内命名空间绑定有不同的规则: 文字结果元素(如 <Invoice>)将样式表中的所有范围内名称空间绑定复制到结果树,但由于 exclude-result-prefixes 排除的任何元素除外。它还添加了元素属性名称可能需要的任何名称空间。 xsl:element 指令使用元素名称及其属性所需的最小范围内命名空间集创建新元素 xsl:copy 或 xsl:copy-of 指令从您正在复制的源元素复制范围内的命名空间绑定。 因此,如果您查看结果文档中 cbc:ID 元素上的名称空间(例如),在我看来好像这个元素是使用 xsl:copy 指令生成的,因此您需要了解 xsl:copy 复制正在复制的源树元素的范围内命名空间。 XSLT 2.0 有一个属性<xsl:copy copy-namespaces="no">,但是在1.0 中,如果你想删除名称空间绑定,你必须从xsl:copy 切换到xsl:element。 AFAICT,您想简单地做: XSLT 1.0 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cac="urn:pagero:CommonAggregateComponents:1.0" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:puf="urn:pagero:ExtensionComponent:1.0" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac0="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" exclude-result-prefixes="inv cac0"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="*"> <xsl:element name="{name()}"> <xsl:apply-templates/> </xsl:element> </xsl:template> <xsl:template match="/inv:Invoice"> <Invoice xmlns="urn:pagero:PageroUniversalFormat:Invoice:1.0"> <xsl:apply-templates/> </Invoice> </xsl:template> <xsl:template match="cac0:*"> <xsl:element name="cac:{local-name()}"> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:element> </xsl:template> </xsl:stylesheet> 我省略了这部分: <!-- Suppress the UBLVersionID element --> <xsl:template match="//*[local-name() = 'UBLVersionID']" /> 因为我在输入中看不到 UBLVersionID 元素。仅依赖元素的本地名称是不好的做法 - 特别是。在重命名空间的 XML 中,例如您的输入。您应该使用完全限定的名称。

回答 2 投票 0

将 Border-radius 放在剪辑路径中

有没有办法在剪辑路径中放置边界半径? 这是我的代码; 剪辑路径:多边形(0 0、100% 0、96% 100%、5% 100%); 边框半径:93px 66px 80px 80px;

回答 1 投票 0

如何将字符串转换为变量/列表名? [重复]

我有一个股票指数列表(indizies)和几个股票代码列表(例如 gdaxi,mdaxi)。 我想分两次从雅虎下载股票。 背景:在真实程序中用户可以

回答 2 投票 0

复选框选项的 jquery 滑块并获取值

我有一些带有值的复选框选项,我需要将其转换为从第一个值到最后一个值的滑块,例如价格过滤器滑块。随着滑块的移动,超出范围的选项变为

回答 1 投票 0

使用不同的投影将经纬度转换为行列时出错

我遵循了这个很好的答案,但是在使用带有 EPSG:21781+5728 的 dem 时我得到了不正确的结果。我正在使用的 dem 可以在这里下载。 我的代码: # latlong 到 rowcol 函数 定义

回答 0 投票 0

我们可以在 Nifi 中编写/准备固定宽度长度的文件类型吗?

我有一个输入 JSON,我想将该 JSON 转换为固定宽度长度的文件格式。 我想知道是否有任何方法可以将 JSON 文件转换为 Nifi 中的固定宽度长度文件格式,

回答 0 投票 0

DndKit 拖放转换延迟,使用 Sortable

当我放下一个元素来求助时,会出现一个轻微的过渡问题,即项目回到其原始位置然后过渡。下面我添加了一个视频和代码的链接。 真的,我...

回答 1 投票 0

React-Slick - 变换:translate3d - 不适用于较小的分辨率

我正在使用 next.js 并通过 API 获取数据到幻灯片。 React-slick 在较低分辨率(本例中为 890px)的第一个断点之前一直很好用。 .slick-track 类有一个属性是...

回答 2 投票 0

如何使用OpenCV匹配拼接成功后获取图像坐标

早上好! 我正在尝试获取已使用 ORB 成功匹配并使用 cv2.warpPerspective 拼接在一起的两个图像的坐标(角的 x,y)。 我已经通过计算试过了...

回答 0 投票 0

将列表列表转换为地图列表

我问了这个问题并得到了答案,但是有另一个版本的输入。 这是另一个版本的输入: [{“分数”:[[4,1],[2,1],[8,5],[7,3],[5,10]]}, {“分数”:[[23,33],...

回答 1 投票 0

将复选框布尔值转换为文本并将其发送到 api 的获取请求中

我有一个学校项目,我正在构建一个食谱搜索应用程序,前端使用 angular,后端使用 laravel,并从 edamams API 获取食谱。我希望能够过滤我的焦...

回答 2 投票 0

将列表列表转换为具有值的地图列表

我正在尝试使用 Jolt 将以下输入转换为所需的输出 [ { “分数”:[ [ 4、 1个 ], [ 2、 1个 ], [ ...

回答 1 投票 0

如何转换表格,使列标题进入表格,表格值成为列标题?

如何在 Python 中使用 pandas 来制作这张表: 数据 = [['4/04/2023','地板','桌子','屋顶','油漆',''],['4/05/2023','','地板','桌子','Roof','Paint'],['4/06/2023','Paint','','Floors','Tabl...

回答 1 投票 0

颠簸条件规格

我想要一个条件转换,如果输入中特定字段的值符合我的条件,我需要在输出中添加一个属性。以下是我需要的输入和输出。 输入 - { “……

回答 0 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.