Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我想在使用 Transformer 接口应用 XSLT 时对 XML 读取应用模式验证,我是否需要首先使用启用验证的 DOMSource 构建一个 DOM,或者有什么方法可以说服它使用 StreamSource 执行此操作?
我想不出使用 StreamSource 的方法,但您应该能够构造一个验证 SAXParser,从中获取 XMLReader 并将其用作 SAXSource 的输入。至少这可以防止在转换之前构建树。但是,无论如何,转换很可能会构建一棵树。