为什么 Spring 配置文件必须定义 DTD 而 XSD 但 Struts 配置文件没有

Why Spring config file must define DTD and XSD but Struts config file does not

我浏览了有关 DTD 的文章,XSD 它们基本上是用合法元素和属性列表定义结构,所以就 spring 而言,我们必须遵循一些指南是可以的线所以每个人都必须在它下面工作。但至于 struts 这种依赖关系是如何管理的,因为在 MVC 的上下文中,spring 和 struts 就像比喻 same.Here,我缺少哪个线程?

非常感谢任何可分享的内容。

已编辑: 这是 spring 配置文件声明

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

这是 struts 配置文件

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC
 "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
 "http://struts.apache.org/dtds/struts-2.0.dtd">

现在在 spring 配置文件命名空间 'xsi' 中看到,它的模式定位由 spring 定义,但仅 struts 配置没有这样的东西 struts dtd 由 struts.

定义

缩写的意思

是不同的语言,但都用于定义文档的结构并验证其内容。使用其中任何一个足以验证文档。使用 DTD,您可以将其转换为 XSD 等。 DTD 或 XSD 是用来描述 XML 文件都没有关系。

但是,DTD 和 XSD 之间的主要区别是最后一个本身 XML 文档而不是第一个不是。

Spring 和 Struts 不同,使用 XML 文档的不同 XML 定义,但这不仅仅是一个区别。