开发者

Is there an XSLT to translate from a BizTalk schema to a W3C XML Schema?

开发者 https://www.devze.com 2023-02-03 11:40 出处:网络
I have an XML document generated by a 3rd party using BizTalk, and I have the BizTalk schema for that document, but I need to validate the document against the schema in .NET.When I try to load the Bi

I have an XML document generated by a 3rd party using BizTalk, and I have the BizTalk schema for that document, but I need to validate the document against the schema in .NET. When I try to load the BizTalk schema I get this message:

'XmlSchemaSet' can load only W3C开发者_运维问答 XML Schemas

Is there some way, possibly an XSLT, to convert from a BizTalk schema language to the W3C XML Schema language?


A "Schema" that need to be deployed in BizTalk for use within the platform starts its life as plain vanilla W3C XML Schema, that is a file with a .xsd extension.

Then, the BizTalk Visual Studio project system converts this plain XML representation of an XSD schema to a .NET class derived from SchemaBase in a compiled .Net assembly to make it more suitable for the BizTalk runtime to consume it.

If you want to validate any given XML document against the schema in .NET, the simplest solution is to get hold of the W3C Schema file originally used as the source for the corresponding BizTalk artifact.

However, if this is not possible, you can reference the .NET assembly that contains the compiled artifact and use reflection to instantiate the generated class. Then, you can use its Schema property to retrieve an instance of the XmlSchema object.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号