简体   繁体   English

如果没有DTD,是否可以将DTD模式添加到biztalk创建的XML中?

[英]Can you add a DTD schema to an biztalk created XML if you don't have the DTD?

We need to create an XML for a SHipping software company that we deal with. 我们需要为我们处理的SHipping软件公司创建XML。

Basically, the output xml needs to contain the below doctype 基本上,输出xml需要包含以下doctype

<!DOCTYPE INTERFACE_CREATE_SHIPMENT SYSTEM "INTERFACE_CREATE_SHIPMENT.dtd"> 

but i don't have this file, so adding it to the mappings Doctype system causes an error so i don't know if it would work. 但我没有此文件,因此将其添加到Mapping Doctype系统会导致错误,所以我不知道它是否会工作。 Is it possible to let BizTalk add this doctype without the DTD being avaible on my side? 是否可以让BizTalk添加该文档类型,而我身边没有DTD? or could i make a new DTD with the same name just to be able to create the file? 还是我可以使用相同的名称创建一个新的DTD以便创建文件?

You just have to set your own custom xml declaration at design time in your pipeline component 您只需要在设计时在管道组件中设置自己的自定义xml声明即可

In the "Add processing instructions text" field you should put 在“添加处理说明文字”字段中,您应该输入

  <?xml version="1.0" standalone="no" ?><!DOCTYPE INTERFACE_CREATE_SHIPMENT SYSTEM "INTERFACE_CREATE_SHIPMENT.dtd">

Don't forget to set the Add XML Declaration to false 不要忘记将Add XML Declaration设置为false

在此处输入图片说明

More details are available here http://cherifmahieddine.com/2013/09/23/custom-biztalk-xml-declaration/ 有关更多详细信息,请参见http://cherifmahieddine.com/2013/09/23/custom-biztalk-xml-declaration/

Assuming you just need the !DOCTYPE declaration, and you can't get the actual .dtd file, you'd have two options: 假设您只需要!DOCTYPE声明,而无法获取实际的.dtd文件,则有两种选择:

  1. Mock up the .dtd file. 模拟.dtd文件。 Not really preferable, as this could cause problems with conflicting definitions, and later developers are likely to misunderstand that it's just a mock file. 并不是很可取,因为这可能导致定义冲突的问题,以后的开发人员可能会误解它只是一个模拟文件。
  2. Create a pipeline component to add the !DOCTYPE declaration in the Encode stage. 创建一个管道组件以在Encode阶段添加!DOCTYPE声明。 This should work as long as you don't need anything special from that dtd. 只要您不需要该dtd的任何特殊功能,它就可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM