XSD文件,从哪里得到的xmlns说法? [英] XSD file, where to get xmlns argument?

查看:143
本文介绍了XSD文件,从哪里得到的xmlns说法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="abc" targetNamespace="http://schemas.businessNameHere.com/SoftwareNameHere" 
           elementFormDefault="qualified" 
           xmlns="http://schemas.businessNameHere.com/SoftwareNameHere" 
           xmlns:mstns="http://schemas.businessNameHere.com/SoftwareNameHere" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="..." type="..." />
<xs:complexType name="...">

我在一个项目中使用XSD生成cs文件的工作。我的问题是关于字符串http://schemas.businessNameHere.com/SoftwareNameHere如果我改变它,这是行不通的。但是,HTTP://不是一个有效的......是什么背后的逻辑在哪里可以我可以什么放在那里的信息或如何改变它

I am working on a project using XSD to generate .cs file. My question is concerning the string "http://schemas.businessNameHere.com/SoftwareNameHere" If I change it, it doesn't work. But the http:// is not a valid one... what is the logic behind and where can I can information about what to put there or how to change it?

推荐答案

的XSD命名空间不必须是有效的URI。有一个命名空间的字符串,是一个URL并不意味着什么是URL,或任何获取与网络做在所有 - 它只是像任何其他的字符串。因此,尽管该URL可能是从感觉无效时它实际上并不指向任何东西,它仍然是一个有效的字符串作为一个命名空间声明。

XSD namespaces do not have to be valid URI's. Having a namespace string that is a URL doesn't mean anything is fetched from the URL, or anything to do with the web at all - it's simply a string like any other. So although the URL may be invalid from the sense that it doesn't actually point to anything, it's still a valid string as a namespace declaration.

您可以在一些空间标识符以这种格式在这里推理读了一>

You can read up on some of the reasoning behind namespace identifiers being in this format here.

有几个原因使用URL作为命名空间标识符,但主要是为了方便起见 - 它是一个唯一的标识符,其通常具有连接到它的用户的一些意义,很像方式的Java的名称空间经典的以com开始组织或网。

There are several reasons for using URL's as a namespace identifier, but mainly it is for convenience - it's a unique identifier that generally has some meaning attached to it for the users, much like the way Java namespaces classically begin with "com", "org" or "net".

有关为什么命名空间是URI的细节问题(从技术上说, IRI 的)格式,可以阅读的 W3C的XML命名空间标准的。在指定XML命名空间是IRI(国际资源标识符)格式,在 RFC3986定义

For the nitty gritty of why namespaces are in URI (technically, IRI) format, you can read the W3C's standards for XML namespaces. The specify that XML Namespaces are in IRI (International Resource Identifier) format, defined in RFC3986.

有关如何,有很多伟大的演练中,像这样的。当您更改命名空间什么是不工作?

For more information on how to properly use namespaces, there are lots of great walkthroughs, like this one. What isn't working when you change the namespace?

这篇关于XSD文件,从哪里得到的xmlns说法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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