【发布时间】:2019-01-02 08:02:33
【问题描述】:
给定以下 XML:
<?xml version="1.0" encoding="utf-8"?>
<Store>
<p1:Document xmlns:p1="urn:iso:std:iso:xyz">
<p1:Class>
Hello
<p1:Type>
Now
</p1:Type>
</p1:Class>
<!-- more elements -->
</p1:Document>
</Store>
我将如何编写 XSLT 以按以下方式转换 Document 元素:
<?xml version="1.0" encoding="utf-8"?>
<Store>
<Document xmlns="urn:iso:std:iso:123>
<Class>
Hello
<Type>
Now
</Type>
</Class>
<!-- more elements -->
</Document>
</Store>
如您所见,我需要复制 Document 元素,但我需要剥离其所有命名空间声明和前缀,然后添加一个新的命名空间声明。
我将如何在 XSL 中完成此任务?
【问题讨论】:
-
@zx485 - 您可能知道答案的新问题! :)