xsl处理xml命名空间的问题

davinic1209 2003-10-21 08:54:57
若有以下的xml文档 涉及命名空间,如何解决

<Document xmlns="urn:schemas-microsoft-com">
<DocumentProperties>
<Title>FlowChart</Title>
</DocumentProperties>
</Document>
...全文
73 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
davinic1209 2003-10-22
  • 打赏
  • 举报
回复
谢谢各位,但以上方法都不行,不知道大家有没看到:

<Document xmlns="urn:schemas-microsoft-com">

这里有命名空间的问题
colee 2003-10-22
  • 打赏
  • 举报
回复
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<xsl:apply-templates select="DocumentProperties"/>
</xsl:template>

<xsl:template match="DocumentProperties">
<xsl:value-of select="Title"/>
</xsl:template>
</xsl:stylesheet>
HONGDUN 2003-10-22
  • 打赏
  • 举报
回复
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<xsl:apply-templates select="DocumentProperties/Title"/>
</xsl:template>

<xsl:template match="DocumentProperties/Title">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
davinic1209 2003-10-21
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="UTF-8"?>
我无法这样获得Title 的值!
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<xsl:apply-templates select="//Title"/>
</xsl:template>

<xsl:template match="Title">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
孟子E章 2003-10-21
  • 打赏
  • 举报
回复
你要解决什么?

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧