我需要这个案子的帮助。为XML文档创建模式。 [英] I need help with this case. Create a schema for an XML document.

查看:71
本文介绍了我需要这个案子的帮助。为XML文档创建模式。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何为XML文档创建架构?这是确切的说明,如果有帮助的话。



为XML文档创建一个模式,该模式将存储医院中患者的信息。有关患者的信息必须包括姓名(3部分),社会安全号码,年龄,房间号码,主要保险公司 - 包括会员身份证号码,团体号码,电话号码和地址 - 二级保险公司(与主要保险公司相同的子部分)保险公司),已知的医疗问题,以及已知的药物过敏。根据您的模式创建一个包含2-3个患者的样本XML文档。

Does anyone know how to create a schema for an XML document? This is the exact instructions, in case it helps.

Create a schema for an XML document that will store information about patients in a hospital. Information about patients must include name (in 3 parts), Social Security number, age, room number, primary insurance company – including member identification number, group number, phone number and address – secondary insurance company (in the same subparts as for the primary insurance company), known medical problems, and known drug allergies. Create a sample XML document with 2-3 patients in it that is valid based on your schema.

推荐答案

这看起来像家庭作业。最好的答案是咨询你的课堂笔记。



如果不是家庭作业,你可以从现有的XML文件在Visual Studio中创建一个模式(你的问题看起来像你先创建架构,然后从它生成xml ...实际上更容易相反)。在Visual Studio中打开xml文件(假设它具有'.xml''扩展名)。点击XML - >创建架构



Viola: - )
This looks like homework. The best answer for this is to consult with your class notes.

If it is not homework, you can create a schema in Visual Studio from an existing XML file (your question looks like you create the schema first, then generate xml from it... it is actually easier the other way around). Open the xml file in Visual Studio (assuming it has ''.xml'' extension). Click XML -> Create Schema

Viola :-)


很难解释OP正在尝试什么..明白。但鉴于TSQL在问题中的缺乏,我会提出这个问题实际上是什么。所以...寻找与这些事情相关的东西,在CPQA,使用谷歌,甚至是BOL:

It''s kind of hard to explain what it is the OP is trying to .. understand. But given the apaucity of TSQL in the question I''d formulate that THAT''S what the question actually is. So ... look for stuff related to these things, here in CPQA, using google, even the BOL:
USE [database]
GO

CREATE TABLE [xml].[tblXMLDocBulkInserted](
	[xmliform] [nvarchar](max) NULL
) ON [PRIMARY]

BULK INSERT [database].[xml].[tblXMLDocBulkInserted]
    FROM ''c:\users\cpqa\js\xmlDocument.xml''

CREATE TABLE [xml].[tblXMLDocBulkInsertedIdx](
	[Idx] [int] IDENTITY(1,1) NOT NULL,
	[xmliform] [nvarchar](max) NULL
) ON [PRIMARY]

INSERT INTO [database].[xml].[tblXMLDocBulkInsertedIdx]
   SELECT * FROM [database].[xml].[tblXMLDocBulkInserted]

SELECT [Idx]
      ,[xmliform]
  FROM [20121212151401555].[xml].[tblXMLDocBulkInserted]
GO

SELECT * FROM  [database].[xml].[tblXMLDocBulkInsertedIdx]
 WHERE [xmliform] LIKE ''%>%<%'' 



在这个回报中你会看到所有这些好东西的清单在架构中。很容易看出它的数据包含了。将此结果与原始输入文档进行比较。



另一方面,这里有一些数据(也许):


In this return you''ll see a list of all those good things found in a "schema". It''s easy to see that there''s data "contained" by it. Compare this result to the original input document.

On the other hand, then, there''s some data here (perhaps):

SELECT * FROM [database].[xml].[tblXMLDocBulkInsertedIdx]
  WHERE [xmliform] NOT LIKE ''%<%''	


这篇关于我需要这个案子的帮助。为XML文档创建模式。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆