To make this code a bit more robust, use a regular expression rather than assuming that the start-tag is exactly as shown above. In particular, you can account for a variety of possible attributes
为了使代码更加健壮,可以使用正则表达式而不是假定起始标签和前面相同。
The number of namespace declarations that can appear in a single start tag is unlimited.
不限制在单个开始标记中可以出现的名称空间声明的数量。
Make all namespace declarations up in the start tag of the document element if at all possible.
如果可能,将所有名称空间的声明都编排到文档元素的开始标记中。
应用推荐