生成GUID的XSLT [英] Generate GUID in XSLT
问题描述
我需要生成XSLT一个GUID,如果需要,C#,没有人知道如何以最佳方式做到这一点?
I need to generate a GUID with XSLT and if needed C#, does anyone know how to best do this?
这是生成HTML项的唯一标识。
It is to generate unique IDs for HTML items.
推荐答案
在XSLT的 生成-ID
函数返回唯一标识文档中的一个节点的字符串。注意:从规范这些警告:
The XSLT generate-id
function returns a string that uniquely identifies a node in the document. Note these warnings from the spec:
这是目前正在实施中没有
义务产生相同的
标识符每次一个文件是
转化。谁也不能保证
,一个生成的唯一标识符
将被从源文件中指定的任何唯一的ID
截然不同。
An implementation is under no obligation to generate the same identifiers each time a document is transformed. There is no guarantee that a generated unique identifier will be distinct from any unique IDs specified in the source document.
不过,如果你需要的是唯一地标识每个元素在你的输出,那么生成-ID
就足够了。
However, if all you need is to uniquely identify each element in your output, then generate-id
is sufficient.
这篇关于生成GUID的XSLT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!