- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要从一些 XML 数据文件中提取数据,以及描述其结构的 XSD。它使用来自几个命名空间的大量复杂类型,这些命名空间本身使用来自更多命名空间的更复杂类型,依此类推。即使在扁平化之后,仍然使用 120 个 XSD。
这是 XSD:
Copyright (C) UN/CEFACT (2008). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to UN/CEFACT, except as needed for the purpose of developing UN/CEFACT specifications, in which case the procedures for copyrights defined in the UN/CEFACT Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by UN/CEFACT or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and UN/CEFACT DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-->
<!--
Schema agency: Florecom / Floricode
Schema version: 0.10
Schema date: 27 september 2013
Copyright (C) Florecom / Floricode (2013). All Rights Reserved.
Sierteelt Invoice
20110510 HvR Upgrade to new Florecom Library RABIE4p0
20110831 HvR Upgrade to development library RABIE5p0 for Pilot FloraHolland Invoice, added PayerParty, InvoicerParty
20120507 HvR Library 2012 juli.
20120612 HvR Upgrade to new Florecom library RABIE6p0.
20130927 HvR Upgrade to new Florecom / Floricode liberary RABIE7p0, added ClearingAgent.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:feccii="urn:fec:florecom:xml:data:draft:CrossIndustryInvoice:10" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:3" xmlns:feram="urn:fec:florecom:xml:data:draft:ReusableAggregateBusinessInformationEntity:7" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:4" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:3" xmlns:ccts="urn:un:unece:uncefact:data:standard:CoreComponentsTechnicalSpecification:2" targetNamespace="urn:fec:florecom:xml:data:draft:CrossIndustryInvoice:10" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.10">
<!-- ======================================================================= -->
<!-- ===== Imports ==== -->
<!-- ======================================================================= -->
<!-- ===== Import of Reusable Aggregate Business Information Entity Schema Module ===== -->
<!-- ======================================================================= -->
<xsd:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:4" schemaLocation="http://www.unece.org/uncefact/data/standard/UnqualifiedDataType_4p0.xsd"/>
<!-- ======================================================================= -->
<!-- ===== Import of Qualified DataType Schema Module ===== -->
<!-- ======================================================================= -->
<xsd:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:3" schemaLocation="http://www.unece.org/uncefact/data/standard/QualifiedDataType_3p0.xsd"/>
<!-- ======================================================================= -->
<!-- ===== Import of Reusable Aggregate Business Information Entity Schema Module ===== -->
<!-- ======================================================================= -->
<xsd:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:3" schemaLocation="http://www.unece.org/uncefact/data/standard/ReusableAggregateBusinessInformationEntity_3p0.xsd"/>
<!-- ======================================================================= -->
<!-- ===== Import of FEC Reusable Aggregate Business Information Entity Schema Module ===== -->
<!-- ======================================================================= -->
<xsd:import namespace="urn:fec:florecom:xml:data:draft:ReusableAggregateBusinessInformationEntity:7" schemaLocation="http://schemas.florecom.org/xml/data/draft/FEC_ReusableAggregateBusinessInformationEntity_7p0.xsd"/>
<!-- ======================================================================= -->
<!-- ===== Element Declarations ===== -->
<!-- ======================================================================= -->
<!-- ===== Root Element Declarations ===== -->
<!-- ======================================================================= -->
<xsd:element name="CrossIndustryInvoice" type="feccii:CrossIndustryInvoiceType">
<xsd:annotation>
<xsd:documentation xml:lang="en">
<ccts:UniqueID>UNMCII1</ccts:UniqueID>
<ccts:Acronym>CII</ccts:Acronym>
<ccts:Name>CrossIndustryInvoice</ccts:Name>
<ccts:Version>1.0</ccts:Version>
<ccts:Definition>The cross industry invoice is an electronic document exchanged between trading partners with a prime function as a request for payment. It is an important accounting document and has potential legal implications for sender and receiver. It is also used in the European Union as the key document for VAT declaration and reclamation, for statistics declaration in respect of intra community trade, and to support export and import declaration in respect of trade with countries outside the European community.</ccts:Definition>
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<!-- ================================================================== -->
<!-- ===== Type Definitions ===== -->
<!-- ================================================================== -->
<!-- ===== Type Definitions: CrossIndustryInvoiceType ===== -->
<!-- ================================================================== -->
<xsd:complexType name="CrossIndustryInvoiceType">
<xsd:sequence>
<xsd:element name="SupplierParty" type="ram:SupplierPartyType" minOccurs="0"/>
<xsd:element name="CustomerParty" type="ram:CustomerPartyType" minOccurs="0"/>
<xsd:element name="BuyerParty" type="ram:BuyerPartyType" minOccurs="0"/>
<xsd:element name="SellerParty" type="ram:SellerPartyType" minOccurs="0"/>
<xsd:element name="ConsignorParty" type="ram:ConsignorPartyType" minOccurs="0"/>
<xsd:element name="ConsigneeParty" type="ram:ConsigneePartyType" minOccurs="0"/>
<xsd:element name="InvoiceeParty" type="ram:InvoiceePartyType" minOccurs="0"/>
<xsd:element name="InvoicerParty" type="feram:InvoicerPartyType" minOccurs="0"/>
<xsd:element name="ManufacturerParty" type="ram:ManufacturerPartyType" minOccurs="0"/>
<xsd:element name="PayeeParty" type="ram:PayeePartyType" minOccurs="0"/>
<xsd:element name="PayerParty" type="feram:PayerPartyType" minOccurs="0"/>
<xsd:element name="InvoiceIssuerParty" type="ram:InvoiceIssuerPartyType" minOccurs="0"/>
<xsd:element name="TaxRepresentativeParty" type="ram:TaxRepresentativePartyType" minOccurs="0"/>
<xsd:element name="CustomerAccountantParty" type="ram:CustomerAccountantPartyType" minOccurs="0"/>
<xsd:element name="SupplierAccountantParty" type="ram:SupplierAccountantPartyType" minOccurs="0"/>
<xsd:element name="ClearingAgentParty" type="feram:ClearingAgentPartyType" minOccurs="0"/>
<xsd:element name="InvoiceTradeLineItem" type="feram:InvoiceTradeLineItemType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="BillingPeriod" type="ram:BillingPeriodType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="TradeTransportMeans" type="ram:TradeTransportMeansType" minOccurs="0"/>
<xsd:element name="TradeTransportMode" type="ram:TradeTransportModeType" minOccurs="0"/>
<xsd:element name="PayableAccountingAccount" type="ram:PayableAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="ReceivableAccountingAccount" type="ram:ReceivableAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="BillingCurrencyExchange" type="ram:BillingCurrencyExchangeType" minOccurs="0"/>
<xsd:element name="PaymentCurrencyExchange" type="ram:PaymentCurrencyExchangeType" minOccurs="0"/>
<xsd:element name="AlternativePaymentCurrencyExchange" type="ram:AlternativePaymentCurrencyExchangeType" minOccurs="0"/>
<xsd:element name="TaxCurrencyExchange" type="ram:TaxCurrencyExchangeType" minOccurs="0"/>
<xsd:element name="PayeeFinancialAccount" type="ram:PayeeFinancialAccountType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="TradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="BillingAdjustment" type="ram:BillingAdjustmentType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="TradeNote" type="ram:TradeNoteType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="TradeDeliveryTerms" type="ram:TradeDeliveryTermsType" minOccurs="0"/>
<xsd:element name="BillingDocument" type="feram:BillingDocumentType"/>
<xsd:element name="BillingPayment" type="ram:BillingPaymentType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="AdvancePayment" type="ram:AdvancePaymentType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="ReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="BillingMonetarySummation" type="ram:BillingMonetarySummationType" minOccurs="0"/>
<xsd:element name="CategorySubtotalTax" type="ram:CategorySubtotalTaxType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
不幸的是,我无法共享实际的数据文件,但它是有效的。 (打乱它会破坏验证。)
我需要一种方便的方法来从 Delphi 代码中提取数据。
RegisterChildNode
和 ChildNodes
调用,为命名空间传递一个空白字符串(这在手动解析时确实有帮助)。现在我遇到了接口(interface)转换错误。有希望让这个生成器工作吗?也许结构太复杂了,我并不真正需要双向绑定(bind)。我正在寻找一种可读的(类似 map /字典?)的数据提取方式(不受 XML 特殊性的支配)。类型安全不是必须的。
这不一定是一个以 Delphi 为中心的问题。恐怕 XSD.exe 对于 .NET 来说也不会做得更好。也许任何人都可以分享经验,让我的工作更轻松
最佳答案
What I'm looking for is a readable (map/dictionary-like?) way of extracting the data (not dominated by the particularities of XML).
你那里有一点问题。寻求从丰富的 XSD 语义映射到简单的字典结构本质上是有问题的。
It's not necessarily a Delphi-centered question. I'm afraid XSD.exe wouldn't do a much better job for .NET. Perhaps anyone can share experience with that to make my job easier.
两个建议:
要根据 XSD 自动测试条件,请利用现有的工具。
对您来说,好消息是 XSD 是 XML 文档,因此可以被许多可以解析 XML 的语言的工具进行解析。
坏消息是,XSD 的语义非常复杂,除了在有限情况下进行简单的抽查之外,您将很难对所有情况进行一般分析。
为了处理 XML 和 XSD,我建议使用基于 XPath 的查询而不是其他技术,特别是如果您可以利用 Schema-aware processing with XSLT 2.0 .
关于xml - 如何轻松提取精心指定的 XML 数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30530258/
正如标题中所问,我有两个如下结构的 XML 文件 A.xml //here I want to include B.xml
我有一个 xml 文件。根据我的要求,我需要更新空标签,例如我需要更改 to .是否可以像那样更改标签.. 谢谢... 最佳答案 var xmlString=" "; var properStri
我有这样简单的 XML: Song Playing 09:41:18 Frederic Delius Violin Son
在我的工作中,我们有自己的 XML 类来构建 DOM,但我不确定应该如何处理连续的空格? 例如 Hello World 当它被读入 DOM 时,文本节点应该包含 Hello 和 World
我有以下 2 个 xml 文件,我必须通过比较 wd:Task_Name_ID 和 TaskID 的 XML 文件 2。 例如,Main XML File-1 wd:Task_Name_ID 具有以下
我在 Rails 应用程序中有一个 XML View ,需要从另一个文件插入 XML 以进行测试。 我想说“构建器,只需盲目地填充这个字符串,因为它已经是 xml”,但我在文档中看不到这样做的任何内容
我正在重建一些 XML 提要,因此我正在研究何时使用元素以及何时使用带有 XML 的属性。 一些网站说“数据在元素中,元数据在属性中。” 那么,两者有什么区别呢? 让我们以 W3Schools 为例:
在同一个文档中有两个 XML 声明是否是格式正确的 XML? hello 我相信不是,但是我找不到支持我的消息来源。 来自 Extensible Markup Language
我需要在包装器 XML 文档中嵌入任意(语法上有效的)XML 文档。嵌入式文档被视为纯文本,在解析包装文档时不需要可解析。 我知道“CDATA trick”,但如果内部 XML 文档本身包含 CDAT
XML 解析器和 XML 处理器是两个不同的东西吗?他们是两个不同的工作吗? 最佳答案 XML 解析器和 XML 处理器是一样的。它不适用于其他语言。 XML 是通用数据标记语言。解析 XML 文件已
我使用这个 perl 代码从一个文件中读取 XML,然后写入另一个文件(我的完整脚本有添加属性的代码): #!usr/bin/perl -w use strict; use XML::DOM; use
我正在编写一个我了解有限的历史脚本。 对象 A 的类型为 system.xml.xmlelement,我需要将其转换为类型 system.xml.xmldocument 以与对象 B 进行比较(类型
我有以下两个 XML 文件: 文件1 101 102 103 501 502 503
我有以下两个 XML 文件: 文件1 101 102 103 501 502 503
我有一个案例,其中一个 xml 作为输入,另一个 xml 作为输出:我可以选择使用 XSL 和通过 JAXB 进行 Unmarshalling 编码。性能方面,有什么真正的区别吗? 最佳答案 首先,程
我有包含 XML 的 XML,我想使用 JAXB 解析它 qwqweqwezxcasdasd eee 解析器 public static NotificationRequest parse(Strin
xml: mario de2f15d014d40b93578d255e6221fd60 Mario F 23 maria maria
尝试更新 xml 文件数组时出现以下错误。 代码片段: File dir = new File("c:\\XML"); File[] files = dir.listFiles(new Filenam
我怎样才能完成这样的事情: PS /home/nicholas/powershell> PS /home/nicholas/powershell> $date=(Get-Date | ConvertT
我在从 xml 文件中删除节点时遇到一些困难。我发现很多其他人通过各种方式在 powershell 中执行此操作的示例,下面的代码似乎与我见过的许多其他示例相同,但我没有得到所需的行为。 我的目标是将
我是一名优秀的程序员,十分优秀!