草庐IT

xml - 这是什么标记语言? ...行尾而不是结束标签

coder 2024-06-25 原文

我正在尝试解析一个看起来与此类似的文档:

<PRESOL>
<DATE>1112
<YEAR>12
<AGENCY>Defense Logistics Agency
<OFFICE>DLA Acquisition Locations
<LOCATION>DLA Land and Maritime
<ZIP>43218-3990
<CLASSCOD>59
<DESC>Proposed procurement for NSN 5365013055528 SPACER,PLATE:
Line 0001 Qty 70.00  UI EA  Deliver To: ARIZONA INDUSTRIES FOR THE BLIND By: 0180 DAYS ADOThe solicitation is an RFQ and will be available at the link provided in this notice.  Hard copies of this solicitation are not available.  Digitized drawings and Military Specifications   and Standards may be retrieved, or ordered, electronically.
All responsible sources may submit a quote which, if timely received, shall be considered.
Quotes must be submitted electronically.

<SETASIDE>HUBZone
.......
</PRESOL>

如您所见,这很奇怪,但也许它曾经是某种标准。整个文档似乎使用了一组有限的空白字符,例如我没有看到 [制表符],但是我确实看到一些较大的数据 block 中有换行符。

这对任何人来说都很眼熟吗?

我正在寻找可以解析它的 Rails gem。

最佳答案

这是一个 FederalBizOpps.gov Presolicitation Notice

预征集通知模板

The Presolicitation Template is used for the publication of notices for proposed acquisitions. FAR, Section 5.2 requires the submission of this document prior to the publication of any further actions. FBO will reject any other documents that refer to a specific solicitation without previous publication of the Presolicitation Notice for that solicitation.

 Tag           Description [Format]
 <PRESOL>                                                              
 <DATE>        Month and day synopsis is submitted [MMDD]
 <YEAR>        Year synopsis is submitted [YY]
 <CBAC>*       User ID for the Office Location. Assigned/managed by your location Administrator.    [string]
 <PASSWORD>*   Password. Assigned/managed by your location Administrator. [string]
 <ZIP>         The Contracting Office's ZIP code [5 Digits]
 <CLASSCOD>*   Either one alphabetic code or a two-digit code for service or supply that the synopsis should be listed under. [Valid classification code (FAR, Section 5.207(g))]
 <NAICS>*      Six-digit code for service or supply that the synopsis would be listed under [Valid NAICS Code]
 <OFFADD>      The complete address of the contracting office [Up to 65535 characters]
 <SUBJECT>     The classification code, two hyphens, and a brief title description of the synopsis. [Up to 255 characters]
 <SOLNBR>*     Unique reference number for the solicitation [Up to 128 characters from the set: a-z A-Z 0-9 - _ ( ) { }]
 <RESPDATE>    Response deadline date [MMDDYY]
 <ARCHDATE>    The date when this notice will be archived. [MMDDYYYY]
 <CONTACT>     The names and phone numbers of officials to contact in regard to this synopsis. If there are two points of contact, their information shall be separated by semicolon [Up to 65535 characters]
 <DESC>        A narrative description of the procurement action. [Up to 65535 characters]
 <LINK>        A structural tag [No data required or accepted]
 <URL>         The Government Agency's URL that will be listed with this award. [Up to 255 characters, consist of a restricted set of characters (see URL specification - RFC 2396)]
 <DESC>        Visible hypertext description provided to the user for linking to the related site [Up to 255 characters]
 <EMAIL>       A structural tag [No data required or accepted]
 <ADDRESS>     The Government Agency contact's email address [Up to 128 characters]
 <DESC>        Visible hypertext description provided for linking to the Government Agency contact's email [Up to 255 characters]
 <SETASIDE>    Identify set-aside acquisitions. [Valid values: 'Competitive 8(a)', 'Emerging Small Business', 'Woman Owned Small Business', 'Economically Disadvantaged Woman Owned Small Business', 'HUBZone', 'Partial HBCU / MI', 'Partial Small Business', 'Service-Disabled Veteran-Owned Small Business', 'Total HBCU / MI', 'Total Small Business', 'Veteran-Owned Small Business']
 <POPADDRESS>  Place of performance address [Up to 65535 characters]
 <POPZIP>      Place of performance ZIP code [Up to 5 digits]
 <POPCOUNTRY>  Place of performance country [Up to 32 characters]
 </PRESOL>     

注意事项

  1. 所有红色标签代表所需数据。
    • 表示经过验证的数据。
  2. <LINK><URL><DESC> 是一组数据,应一起提供或省略。
  3. <EMAIL><ADDRESS><DESC> 是一组数据,应一起提供或省略。

例子

<PRESOL> 
<DATE> 0521 
<YEAR> 99 
<CBAC> demo 
<PASSWORD> DEMO 
<ZIP> 22030 
<CLASSCOD> B 
<NAICS>123456 
<OFFADD> Office of Environmental Studies; 1323 Y Street, Washington, DC 22030 
<SUBJECT> B--ENERGY AND ENVIRONMENTAL SERVICES KNOWLEDGE DEVELOPMENT AND DISSEMINATION ACTIVITIES REGARDING THE HOMELESS MENTALLY ILL POPULATION 
<SOLNBR> 208-94-0008 
<RESPDATE> 061399 
<ARCHDATE> 07131999 
<CONTACT> Mary Ann Deal, Contract Specialist, 301-443-5329; Contracting Officer, Beatrice L. Woods, 301-443-0043 
<DESC> The Center for Mental Health Services is soliciting proposals on a full and open competitive basis from qualified organizations to award a 3-year contract to develop and disseminate new knowledge about effective approaches to providing comprehensive community-based services to persons with serious mental illnesses who are homeless. 
<LINK> 
<URL> http://www.abc.gov 
<DESC> Center for Mental Health <EMAIL> <ADDRESS> johndoe@usa.gov 
<DESC> Center for Mental Health <SETASIDE> Total Small Disadvantage Business 
<POPADDRESS> Office of Environmental Studies; 1323 Y Street; Washington, DC 22030 
<POPZIP> 22030 
<POPCOUNTRY> US 
</PRESOL>

关于xml - 这是什么标记语言? ...行尾而不是结束标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13371390/

有关xml - 这是什么标记语言? ...行尾而不是结束标签的更多相关文章

  1. ruby - 为什么我可以在 Ruby 中使用 Object#send 访问私有(private)/ protected 方法? - 2

    类classAprivatedeffooputs:fooendpublicdefbarputs:barendprivatedefzimputs:zimendprotecteddefdibputs:dibendendA的实例a=A.new测试a.foorescueputs:faila.barrescueputs:faila.zimrescueputs:faila.dibrescueputs:faila.gazrescueputs:fail测试输出failbarfailfailfail.发送测试[:foo,:bar,:zim,:dib,:gaz].each{|m|a.send(m)resc

  2. ruby-on-rails - Rails - 子类化模型的设计模式是什么? - 2

    我有一个模型:classItem项目有一个属性“商店”基于存储的值,我希望Item对象对特定方法具有不同的行为。Rails中是否有针对此的通用设计模式?如果方法中没有大的if-else语句,这是如何干净利落地完成的? 最佳答案 通常通过Single-TableInheritance. 关于ruby-on-rails-Rails-子类化模型的设计模式是什么?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.co

  3. ruby - 如何将脚本文件的末尾读取为数据文件(Perl 或任何其他语言) - 2

    我正在寻找执行以下操作的正确语法(在Perl、Shell或Ruby中):#variabletoaccessthedatalinesappendedasafileEND_OF_SCRIPT_MARKERrawdatastartshereanditcontinues. 最佳答案 Perl用__DATA__做这个:#!/usr/bin/perlusestrict;usewarnings;while(){print;}__DATA__Texttoprintgoeshere 关于ruby-如何将脚

  4. ruby - 什么是填充的 Base64 编码字符串以及如何在 ruby​​ 中生成它们? - 2

    我正在使用的第三方API的文档状态:"[O]urAPIonlyacceptspaddedBase64encodedstrings."什么是“填充的Base64编码字符串”以及如何在Ruby中生成它们。下面的代码是我第一次尝试创建转换为Base64的JSON格式数据。xa=Base64.encode64(a.to_json) 最佳答案 他们说的padding其实就是Base64本身的一部分。它是末尾的“=”和“==”。Base64将3个字节的数据包编码为4个编码字符。所以如果你的输入数据有长度n和n%3=1=>"=="末尾用于填充n%

  5. ruby - 解析 RDFa、微数据等的最佳方式是什么,使用统一的模式/词汇(例如 schema.org)存储和显示信息 - 2

    我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i

  6. ruby - 为什么 4.1%2 使用 Ruby 返回 0.0999999999999996?但是 4.2%2==0.2 - 2

    为什么4.1%2返回0.0999999999999996?但是4.2%2==0.2。 最佳答案 参见此处:WhatEveryProgrammerShouldKnowAboutFloating-PointArithmetic实数是无限的。计算机使用的位数有限(今天是32位、64位)。因此计算机进行的浮点运算不能代表所有的实数。0.1是这些数字之一。请注意,这不是与Ruby相关的问题,而是与所有编程语言相关的问题,因为它来自计算机表示实数的方式。 关于ruby-为什么4.1%2使用Ruby返

  7. ruby-on-rails - 如何从 format.xml 中删除 <hash></hash> - 2

    我有一个对象has_many应呈现为xml的子对象。这不是问题。我的问题是我创建了一个Hash包含此数据,就像解析器需要它一样。但是rails自动将整个文件包含在.........我需要摆脱type="array"和我该如何处理?我没有在文档中找到任何内容。 最佳答案 我遇到了同样的问题;这是我的XML:我在用这个:entries.to_xml将散列数据转换为XML,但这会将条目的数据包装到中所以我修改了:entries.to_xml(root:"Contacts")但这仍然将转换后的XML包装在“联系人”中,将我的XML代码修改为

  8. ruby - 在院子里用@param 标签警告 - 2

    我试图使用yard记录一些Ruby代码,尽管我所做的正是所描述的here或here#@param[Integer]thenumberoftrials(>=0)#@param[Float]successprobabilityineachtrialdefinitialize(n,p)#initialize...end虽然我仍然得到这个奇怪的错误@paramtaghasunknownparametername:the@paramtaghasunknownparametername:success然后生成的html看起来很奇怪。我称yard为:$yarddoc-mmarkdown我做错了什么?

  9. ruby - ruby 中的 TOPLEVEL_BINDING 是什么? - 2

    它不等于主线程的binding,这个toplevel作用域是什么?此作用域与主线程中的binding有何不同?>ruby-e'putsTOPLEVEL_BINDING===binding'false 最佳答案 事实是,TOPLEVEL_BINDING始终引用Binding的预定义全局实例,而Kernel#binding创建的新实例>Binding每次封装当前执行上下文。在顶层,它们都包含相同的绑定(bind),但它们不是同一个对象,您无法使用==或===测试它们的绑定(bind)相等性。putsTOPLEVEL_BINDINGput

  10. ruby - Infinity 和 NaN 的类型是什么? - 2

    我可以得到Infinity和NaNn=9.0/0#=>Infinityn.class#=>Floatm=0/0.0#=>NaNm.class#=>Float但是当我想直接访问Infinity或NaN时:Infinity#=>uninitializedconstantInfinity(NameError)NaN#=>uninitializedconstantNaN(NameError)什么是Infinity和NaN?它们是对象、关键字还是其他东西? 最佳答案 您看到打印为Infinity和NaN的只是Float类的两个特殊实例的字符串

随机推荐