내 (이 경우 시나리오 간체)되는 XSLT의 출력 (노 네임 스페이스) 속성은 XML :는 XMLNS 제거하는 방법 = ""
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foo="http://www.foo.org">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="foo:doc">
<xsl:element name="newdoc" namespace="http://www/w3.org/1999/xhtml">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="foo:div">
<segment title="{foo:title}">
<xsl:apply-templates/>
</segment>
</xsl:template>
<xsl:template match="foo:title">
<xsl:element name="h2">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="foo:paragraph">
<xsl:element name="p">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
: 여기
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="test_1.xsl" type="text/xsl"?>
<doc xmlns="http://www.foo.org">
<div>
<title>Mr. Title</title>
<paragraph>This is one paragraph.
</paragraph>
<paragraph>Another paragraph.
</paragraph>
</div>
</doc>
그리고 내 XSLT 없다 세그먼트 엘리먼트 = ""xmlns 속성을 제외한 크다
<newdoc xmlns="http://www/w3.org/1999/xhtml">
<segment xmlns="" title="Mr. Title">
<h2>Mr. Title</h2>
<p>This is one paragraph.
</p>
<p>Another paragraph.
</p>
</segment>
</newdoc>
는, 그 자체로 네임 스페이스를 정의되지 같다 :
출력이 생성 그리고 모든 아이들. 이걸 추가하지 않으려면 어떻게해야합니까?
(!) 참고 : 또한 대신
<xsl:template match="mydoc:doc">
<html xmlns="http://www/w3.org/1999/xhtml">
<xsl:apply-templates/>
</html>
</xsl:template>
으로 첫 번째 노드가 바뀌는 시도하지만 동일한 효과를 생성한다.
도움이되는 사람들입니다.
örn : 감사합니다! 매력처럼 작동하고, 나는 지금 그것을 얻는다라고 생각한다. – Zori
이것은 나에게도 도움이되었지만 대답에는 오타가 있습니다. 대답은'http : //www/w3.org ...''http://www.w3.org ... '라고 말해야합니다. 슬래시는 점이어야합니다. – maddoxej