c# - 在 XSLT 中生成 GUID

标签 c# xslt guid umbraco

我需要用 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/

相关文章:

xml - 使用 XSLT 1.0 对多个属性进行分组

ruby-on-rails - 我需要为我的 Rails 应用程序生成 uuid。我有哪些选择( gem )?

关于 GUID 分区表规范的困惑

windows - 什么是 USB 设备 GUID 及其含义

C#,捕获异常

javascript - 在下拉列表中实现垂直滚动条

c# - 组合框事件 SelectedValueChanged

xml - 错误 : Prefix must resolve to a namespace

c# - ASP.NET vNext - MissingMethodException : Method not found: Microsoft. CodeAnalysis.Diagnostic> EmitResult.get_Diagnostics()'

c# - 远程服务器返回错误 : (412) The condition specified using HTTP conditional header(s) is not met. 。