English 中文(简体)
• 在XSL型牌照中开发XSL名称空间
原标题:Dropping the XSL namespace prefix in XSL Stylesheet Tags

是否有可能将<代码>xsl:降至XSL tags in XSL formsheets?

例如,可以:

<xsl:if test=  >

类型如下:

<if test=  >

Edit: Stylesheet has HTML and XML nodes within it.

Thanks, Ross

最佳回答

保证你能够把@ysdx和@Jon的答复结合起来,但必须认识到,你的SLT处理器需要区分XSLT的要素和产出要素。 例如,如下文 style在Perein留下了一个错误:

<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
    <template match="/">
        <!-- <b> is not a valid XSLT element -->
        <b><value-of select=" test "/></b>
    </template>
</stylesheet>

这就意味着你们需要确定产出要素的名称,例如:

<stylesheet version="1.0" 
         xmlns="http://www.w3.org/1999/XSL/Transform"
         xmlns:test="http://whatever">
    <template match="/">
        <test:b><value-of select=" test "/></test:b>
    </template>
</stylesheet>

This can be problematic. You should stick to the conventional xsl prefix, unless you can think of a good reason not to.

问题回答

确实,你可以这样做,将SLT(http://www.w3.org/1999/XSL/Transform)的名称空间定为默认名称空间:

 <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform">
    ...
 </stylesheet>

倒数是,你随后必须使用另一处预设号,用于你的“多功能”名称空间:

 <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:foo="http://whatever" xmlns:html="http://www.w3.org/1999/xhtml">
    <template match="foo:bar">
       <html:form>
           ...
       </html:form>
    </template>
 </stylesheet>

Don t think so. They differentiate between the "language" and any nodes that are intended for output.

Yes.

但确实注意到,这与《欧洲空间法中心》本身,但与《欧洲空间法中心名称》无关。 因此,XML1.0和XML1.1的使用之间存在差异。

例如,在座各位利用这一辛迪加做了一些初步回答:

iii

XSLT 多次重置:





相关问题
When test hanging in an infinite loop

I m tokenising a string with XSLT 1.0 and trying to prevent empty strings from being recognised as tokens. Here s the entire function, based on XSLT Cookbook: <xsl:template name="tokenize"> ...

quick xslt for-each question

Let s say I have an XML document that has this: <keywords> <keyword>test</keyword> <keyword>test2</keyword> <keyword>test3</keyword> <keyword>test4</...

XSLT Transform XML with Namespaces

I m trying to transform some XML into HTML using XSLT. Problem: I can t get it to work. Can someone tell me what I m doing wrong? XML: <ArrayOfBrokerage xmlns:i="http://www.w3.org/2001/...

XSLT output to HTML

In my XSLT file, I have the following: <input type="button" value= <xsl:value-of select="name">> It s an error as it violates XML rule. What I actually want is having a value from an ...

Mangling IDs and References to IDs in XML

I m trying to compose xml elements into each other, and the problem I am having is when there s the same IDs. Basically what I need to do is mangle all the IDs in an xml file, as well as the ...

Sharepoint 2007 Data view Webpart custom parameters

I m sort of new to the custom parameters that can be setup on a DataView Webpart. There are 6 options: - None - Control - Cookie - Form - QueryString - Server Variable I think that None, Cookie and ...

热门标签