我需要用 XSLT 生成一个 GUID,如果需要的话用 C#,有人知道如何最好地做到这一点吗?
它是为 HTML 项目生成唯一的 ID。
最佳答案
XSLT generate-id
function返回唯一标识文档中节点的字符串。请注意规范中的这些警告:
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.
但是,如果您只需要唯一标识输出中的每个元素,那么 generate-id
就足够了。
关于c# - 在 XSLT 中生成 GUID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5494175/