XHTML中的xmlns [英] xmlns in XHTML

查看:94
本文介绍了XHTML中的xmlns的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,


我正在使用Norman Walsh的XSLT将一些DocBook XML内容转换为HTML格式。


但是我注意到Norman Walsh的DocBook XSLT在转换后的文档中包含了

标记后的



< meta xmlns =" http://www.w3.org/1999/xhtml" ......


我认为XML命名空间只能在< html />中声明标签为

例如:

< html xmlns =" http://www.w3.org/1999/xhtml" XML:朗= QUOT;恩" lang =" en">

是声明命名空间的正确方法。


< meta xmlns =" http:// www。 w3.org/1999/xhtml" ......就是Norman

Walsh's
XSLT产生的,我认为是不正确的。我可能错了。


在我向OASIS提交错误报告之前,我只是为了确保我没有错过任何东西。如果我错误的xmlns

声明,请告诉我。


以下是从DocBook XML转换为HTML的一些示例文档

使用诺曼的XSLT: http://www.xml-dev。 com / blog /#88

谢谢。

Saqib Ali

-------- -----
http://validate.sf.net < ----(X)HTML / DocBook XML Validator和

Transformer

Hello All,

I am using Norman Walsh''s XSLTs to transform some DocBook XML content
to HTML.

However I noticed that Norman Walsh''s DocBook XSLT includes the
following
tag in the transformed document:
<meta xmlns="http://www.w3.org/1999/xhtml" ......

I think the XML Namespace can only be declared in <html/> tag for
e.g.:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
is the correct way to declare the namespace.

<meta xmlns="http://www.w3.org/1999/xhtml" ...... is what Norman
Walsh''s
XSLT produced, which I think is incorrect. I might be wrong.

Before I submit a bug-report to OASIS, I just to make sure that I m
not missing something. Let me know if I am wrong about xmlns
declaration.

Here are some sample documents transformed from DocBook XML to HTML
using Norman''s XSLTs: http://www.xml-dev.com/blog/#88

Thanks.
Saqib Ali
-------------
http://validate.sf.net <---- (X)HTML / DocBook XML Validator and
Transformer

推荐答案

2004年5月5日10:39 :31 -0700, sa***@stonebeat.org (Saqib Ali)写道:
On 5 May 2004 10:39:31 -0700, sa***@stonebeat.org (Saqib Ali) wrote:
在我向OASIS提交错误报告之前,我只是为了确保我没有错过任何东西。


这是一个线索 - 诺曼沃尔什_really_知道他在做什么。很多,很多人也一遍又一遍地使用这些样式表。我不是没有b $ b说没有错误,但很明显很快就找到了。

如果我对xmlns
声明有误,请告诉我。
Before I submit a bug-report to OASIS, I just to make sure that I m
not missing something.
Here''s a clue - Norman Walsh _really_ knows what he''s doing. Many,
many people have also used those stylesheets over and over. I''m not
saying there are no bugs left, but obvious ones get found quickly.
Let me know if I am wrong about xmlns
declaration.




是。



Yes.


> >让我知道我是否错误xmlns
> >Let me know if I am wrong about xmlns
声明。



是。



Yes.



您能否更具体地说明它允许的XHTML DTD中的位置

xmlns属性位于< META />中标签???


我正在查看XHTML DTD @ http://www.w3.org/TR/xhtml1/#dtds

似乎只允许在< html />中使用xmlns属性;标签。


能否请您指出DTD中的确切位置,这允许

xmlns属性位于< meta />中标签。


谢谢。

和平,

Saqib Ali
http://validate.sf.net


" Saqib Ali" < SA *** @ stonebeat.org>在消息新闻中写道:d2 ************************** @ posting.google.c om ...
"Saqib Ali" <sa***@stonebeat.org> wrote in message news:d2**************************@posting.google.c om...
您能否更具体地说明XHTML DTD中的哪个位置允许xmlns属性位于< META />中?标签???
我正在查看XHTML DTD @ http ://www.w3.org/TR/xhtml1/#dtds 它似乎只允许在< html />中使用xmlns属性标签。
Can you please be more specific as to where in the XHTML DTD it allows
the xmlns attribute to be in the <META /> TAG ???
I was looking at the XHTML DTD @ http://www.w3.org/TR/xhtml1/#dtds it
seems like xmlns attribute is only allowed in the <html /> TAG.




观察html标签上的xmlns属性是否为FIXED。由此得出的推论是,由DTD定义的所有子元素必须属于同一名称空间URI,而不是其他名称。

带命名空间的XML建议(XHTML

所基于的)是为了解决此限制而创建的。在这个

建议中固有的是在任何地方声明命名空间的自由。


描述了XHTML与其他命名空间之间的关系

in XHTML 1.0建议的第3.1.2节,
http://www.w3.org/TR/2000/REC-xhtml1...6/#well-formed


如果必须针对DTD进行验证,由于DTD无法支持命名空间,因此Doc-

Book XSLT生成的XHTML并不严格符合。这是由于DTD已知的

限制,而不是与XHTML

推荐的不一致。


XHTML 1.1包括信息丰富的XML Schema,可以更广泛地使用XML命名空间声明。

Derek Harmon



Observe that the xmlns attribute on the html tag is FIXED. The inference
drawn from this is that all the child elements defined by the DTD must
belong to the same namespace URI, and no others.

The "XML with Namespaces" recommendation (on which XHTML
is based) was created to address this limitation. Inherent in this
recommendation is the freedom to declare namespaces anyplace.

The relationship between XHTML and other namespaces is described
in section 3.1.2 of the XHTML 1.0 recommendation,

http://www.w3.org/TR/2000/REC-xhtml1...6/#well-formed

If you must validate against a DTD, since DTDs are incapable of
supporting namespaces, then the XHTML produced by the Doc-
Book XSLT is not strictly conforming. This is due to a known
limitation of the DTD, rather than incongrueity with the XHTML
recommendation.

XHTML 1.1 includes informative XML Schemas, that accomodate
the broader use of XML namespace declarations.
Derek Harmon


这篇关于XHTML中的xmlns的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆