|
5 | 5 | [[xsd-schemas]]
|
6 | 6 | == XML Schemas
|
7 | 7 |
|
8 |
| -This part of the appendix lists XML schemas for data access. |
| 8 | +This part of the appendix lists XML schemas for data access, including the following: |
| 9 | + |
| 10 | +* <<xsd-schemas-tx>> |
| 11 | +* <<xsd-schemas-jdbc>> |
9 | 12 |
|
10 | 13 |
|
11 | 14 |
|
12 | 15 | [[xsd-schemas-tx]]
|
13 |
| -=== The `tx` schema |
| 16 | +=== The `tx` Schema |
14 | 17 |
|
15 | 18 | The `tx` tags deal with configuring all of those beans in Spring's comprehensive support
|
16 | 19 | for transactions. These tags are covered in the chapter entitled
|
17 | 20 | <<data-access.adoc#transaction,Transaction Management>>.
|
18 | 21 |
|
19 |
| -[TIP] |
20 |
| -==== |
21 |
| -
|
22 |
| -You are strongly encouraged to look at the `'spring-tx.xsd'` file that ships with the |
23 |
| -Spring distribution. This file is (of course), the XML Schema for Spring's transaction |
24 |
| -configuration, and covers all of the various tags in the `tx` namespace, including |
25 |
| -attribute defaults and suchlike. This file is documented inline, and thus the |
| 22 | +TIP: We strongly encourag you to look at the `'spring-tx.xsd'` file that ships with the |
| 23 | +Spring distribution. This file contains the XML Schema for Spring's transaction |
| 24 | +configuration and covers all of the various elements in the `tx` namespace, including |
| 25 | +attribute defaults and similar information. This file is documented inline, and, thus, the |
26 | 26 | information is not repeated here in the interests of adhering to the DRY (Don't Repeat
|
27 | 27 | Yourself) principle.
|
28 | 28 | ====
|
29 | 29 |
|
30 |
| -In the interest of completeness, to use the tags in the `tx` schema, you need to have |
31 |
| -the following preamble at the top of your Spring XML configuration file; the text in the |
| 30 | +In the interest of completeness, to use the elements in the `tx` schema, you need to have |
| 31 | +the following preamble at the top of your Spring XML configuration file. The text in the |
32 | 32 | following snippet references the correct schema so that the tags in the `tx` namespace
|
33 |
| -are available to you. |
| 33 | +are available to you: |
34 | 34 |
|
| 35 | +==== |
35 | 36 | [source,xml,indent=0]
|
36 | 37 | [subs="verbatim,quotes"]
|
37 | 38 | ----
|
38 | 39 | <?xml version="1.0" encoding="UTF-8"?>
|
39 | 40 | <beans xmlns="http://www.springframework.org/schema/beans"
|
40 | 41 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
41 | 42 | xmlns:aop="http://www.springframework.org/schema/aop"
|
42 |
| - __xmlns:tx="http://www.springframework.org/schema/tx"__ xsi:schemaLocation=" |
| 43 | + xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" <1> |
43 | 44 | http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
44 |
| - __http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd__ |
| 45 | + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd <2> |
45 | 46 | http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <!-- bean definitions here -->
|
46 | 47 |
|
47 | 48 | </beans>
|
48 | 49 | ----
|
49 |
| - |
50 |
| -[NOTE] |
| 50 | +<1> Specify the namespace. |
| 51 | +<2> Specify the location (with other schema locations). |
51 | 52 | ====
|
52 |
| -Often when using the tags in the `tx` namespace you will also be using the tags from the |
| 53 | +
|
| 54 | +NOTE: Often, when you use the elements in the `tx` namespace, you are also using the elements from the |
53 | 55 | `aop` namespace (since the declarative transaction support in Spring is implemented
|
54 |
| -using AOP). The above XML snippet contains the relevant lines needed to reference the |
55 |
| -`aop` schema so that the tags in the `aop` namespace are available to you. |
56 |
| -==== |
| 56 | +by using AOP). The preceding XML snippet contains the relevant lines needed to reference the |
| 57 | +`aop` schema so that the elements in the `aop` namespace are available to you. |
57 | 58 |
|
58 | 59 |
|
59 | 60 |
|
60 | 61 | [[xsd-schemas-jdbc]]
|
61 |
| -=== The `jdbc` schema |
| 62 | +=== The `jdbc` Schema |
62 | 63 |
|
63 |
| -The `jdbc` tags allow you to quickly configure an embedded database or initialize an |
64 |
| -existing data source. These tags are documented in |
65 |
| -<<data-access.adoc#jdbc-embedded-database-support,Embedded database support>> |
66 |
| -and <<data-access.adoc#jdbc-initializing-datasource,Initializing a DataSource>> respectively. |
| 64 | +The `jdbc` elements let you quickly configure an embedded database or initialize an |
| 65 | +existing data source. These elements are documented in |
| 66 | +<<data-access.adoc#jdbc-embedded-database-support,Embedded Database Support>> |
| 67 | +and <<data-access.adoc#jdbc-initializing-datasource,Initializing a DataSource>>, respectively. |
67 | 68 |
|
68 |
| -To use the tags in the `jdbc` schema, you need to have the following preamble at the top |
69 |
| -of your Spring XML configuration file; the text in the following snippet references the |
70 |
| -correct schema so that the tags in the `jdbc` namespace are available to you. |
| 69 | +To use the elements in the `jdbc` schema, you need to have the following preamble at the top |
| 70 | +of your Spring XML configuration file. The text in the following snippet references the |
| 71 | +correct schema so that the elements in the `jdbc` namespace are available to you: |
71 | 72 |
|
| 73 | +==== |
72 | 74 | [source,xml,indent=0]
|
73 | 75 | [subs="verbatim,quotes"]
|
74 | 76 | ----
|
75 | 77 | <?xml version="1.0" encoding="UTF-8"?>
|
76 | 78 | <beans xmlns="http://www.springframework.org/schema/beans"
|
77 | 79 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
78 |
| - __xmlns:jdbc="http://www.springframework.org/schema/jdbc"__ xsi:schemaLocation=" |
| 80 | + xmlns:jdbc="http://www.springframework.org/schema/jdbc" xsi:schemaLocation=" <2> |
79 | 81 | http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
80 |
| - __http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd"__> <!-- bean definitions here --> |
| 82 | + http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd"> <!-- bean definitions here --> <2> |
81 | 83 |
|
82 | 84 | </beans>
|
83 | 85 | ----
|
| 86 | +<1> Specify the namespace. |
| 87 | +<2> Specify the location (with other schema locations). |
| 88 | +==== |
0 commit comments