第四个类型替换将检查type属性是否存在。
The fourth type alternative checks whether the type attribute exists.
为了克服xsi:type的缺陷,可以使用类型替换机制。
To address the shortcomings of xsi: type, you can use the type alternative mechanism.
如果不接受该默认设置,可以用另一种记录集类型替换。
Rather than accepting this default, you can substitute another recordset type.
如果元素声明具有类型替换,那么将按照在模式中指定的顺序进行计算。
If an element declaration has type alternatives, they are evaluated in the order that they were specified in the schema.
它允许模式作者在元素声明中根据XPath表达式的值指定类型替换。
This allows the schema author to specify type substitutions on an element declaration which are selected based on the evaluation of XPath expressions.
现在我们已经完成了最简单的处理部分,剩下的惟一部分是实际的类型替换处理。
Now that I've worked through the easy parts of the processing, the only part remaining is the actual type substitution handling.
其XPath表达式计算为true的第一个类型替换使用选择的类型。
The first type alternative whose XPath expression evaluates to true is the type that is selected.
如清单18 所示,title元素的实例演示了如何选择不同的类型替换。
The instances of the title element, Listing 18, illustrate how the different type alternatives are selected.
签名定义了泛型实际使用的参数类型,所以它提供了处理类型替换时需要的信息。
A signature defines the actual parameter types used with a generic type, so it provides the information I'll need to process type substitutions.
在XMLSchema 1.0中,xsi:type被作为一种类型替换机制引入。
In XML Schema 1.0, xsi: type was introduced as a mechanism for type substitution.
要在实例文档中对元素指定xsi:type,使用派生类型替换声明的类型。
Xsi: type is specified on an element in the instance document to replace the declared type with a derived one.
在清单6底部的输出中(为了格式化稍微重新调整了结构),可以看到类型替换代码的作用。
You can see the type substitution code in action in the output at the bottom of Listing 6 (restructured slightly for formatting).
类型替换的第一个实例在输出的第4和第5行,里面指定了ArrayList实例中值的类型。
The first instance of type substitution is in the fourth and fifth lines of the output, where the types of values in the ArrayList instances are specified.
title的元素声明有一个xs:anytype基类型并且指定了5个类型替换。
The element declaration for title has a base type of xs: anyType and specifies five type alternatives.
如果类型属性的值不是这三个值,前三个类型替换的XPath表达式将计算为false。
If the type attribute has none of these values, the XPath expressions for the first three type alternatives will evaluate to false.
alternative的type属性的值对应于类型替换模式组件的类型定义属性。
The value of the type attribute on xs:alternative corresponds to the type definition property of the type alternative schema component.
然而,如果针对已经具有自己的类型替换的词汇表编写XML模式,那么xsi:type不会起作用。
If, however, you write an XML schema for a vocabulary which already has its own notion of type substitution, then xsi: type will not work.
前三个类型替换根据type属性的值(text、html或 xhtml)选择类型。
The first three type alternatives select a type based on the value of the type attribute being text, html, or xhtml.
现在我们已经介绍了类型替换的原理,现在来看一个示例(清单17),看看如何使用它编写针对Atom的模式。
Now that we have described how the type alternatives mechanism works, look at an example (Listing 17) of how you can use it to write a schema for Atom.
类型替换模式组件包含一个test属性(一个XPath表达式属性记录)、一个类型定义和一个annotations属性。
The type alternative schema component contains a test property which is an XPath expression property record, a type definition, and an annotations property.
这些类型替换将依次执行计算,直到其中一个XPath表达式的值为true(如果值均不为true,则选择默认的类型定义)。
The type alternatives are evaluated in order until one of the XPath expressions evaluates to true (or, if none evaluate to true, the default type definition is chosen).
在XMLSchema 1.1中,元素声明的类型表中可以包含一个类型替换组件序列和一个默认类型定义(也是一个类型替换)。
In XML Schema 1.1, element declarations can have a type table which contains a sequence of type alternative components and a default type definition (which is also a type alternative).
如果特别针对XMLSchema使用设计xml词汇表,那么这种机制非常有用,并且词汇表实例需要使用xsi:type实现类型替换。
This mechanism works well if you design an XML vocabulary specifically for use with XML Schema and you require that instances of your vocabulary use xsi: type for type substitution.
XMLSchema 1.1引入了一种称为类型替换(typealternatives)的新机制,允许模式作者在元素声明中指定类型替换。
XML schema 1.1 introduces a new mechanism called type alternatives that allow the schema author to specify type substitutions on an element declaration.
应该谨慎选择代理流程的类型,因为无法容易地替换此流程。
Choose the type of the proxy process carefully because this process cannot be replaced easily.
不需要关闭系统,您也可以将出现问题的PCi热插拔适配器替换为同类型的另一块适配器。
You can also replace a defective PCI hot plug adapter with another of the same type without shutting down the system.
米德里比斯是一款文字游戏,玩家在游戏中得到一个简短的故事并用同一类型的不同单词替换主要类型的单词,从而创建同一个故事的更无聊的新版本。
Mad Libs is a word game where the player takes a short story and replace key types of words with different words of the same type to create a new, sillier version of the same story.
将记录(usd)中第二个货币类型值替换为来自SAMPLE_VAR2的定制代码。
Substitute the second currency type value in the recording (USD) with custom code from SAMPLE_VAR2.
开始用其他单词标记替换单词类型。
Start by replacing the word types with different word tokens.
开始用其他单词标记替换单词类型。
Start by replacing the word types with different word tokens.
应用推荐