首页 \ 问答 \ 如何将字符串转换为xml(How to convert string to xml)

如何将字符串转换为xml(How to convert string to xml)

我有一个包含XML数据的字符串,我想将其转换为XML文档对象。 我怎么做?


I have a string which contains XML data and I want to convert it to XML document object. How do I do that?


原文:https://stackoverflow.com/questions/4130876
更新时间:2021-10-03 14:10

最满意答案

你总是可以转换为Float

(format "%3f" (float (/ 1 2)))

You can always convert to Float:

(format "%3f" (float (/ 1 2)))

相关问答

更多
  • 新的易失性与真正的“变量”(就像它来自许多其他编程语言一样),因为它可以用于clojure。 从公告 : 有一组新功能( volatile! , vswap! , vreset! , volatile? )创建并使用易失性“盒子”来保持有状态换能器的状态。 挥发物比原子快,但放弃原子性保证,所以只能用于线程隔离。 例如,你可以像设置C中的变量一样设置/获取和更新它们。唯一的附加(也就是名称)是实际Java对象的volatile关键字。 这是为了防止JVM进行优化,并确保它在每次访问时都读取内存位置。 从JI ...
  • 问题是你使用let是错误的。 让这样的作品: (let [identifier (expr)]) 所以你的例子应该是这样的: (let [s (Scanner. "a b c")] (exprs)) 你只能使用在let的范围内(开始和结束的parens)所做的词汇绑定。 只需创建一组词汇绑定。 我使用def来进行全局绑定,并允许绑定我只希望在let的范围内的东西,因为它使事情保持干净。 他们都有他们的用途。 注意:(类)与(新类)相同,它只是语法糖。 The problem is that your ...
  • Rich Hickey(他是Clojure的设计师)评论说,这是wiki上的第一个参考链接: 你是否选择了从“关闭”一词开始的名字,并用“j”代替“s”? 这似乎很有可能,但是这样做会很好。 这个名字被选为独一无二的。 我想要涉及c(c#),l(lisp)和j(java)。 一旦我想出了Clojure,给予关闭的双关语,可用的域名和谷歌空间的空虚,这是一个容易的决定。 http://groups.google.com/group/clojure/msg/766b75baa7987850 Rich Hicke ...
  • 你总是可以转换为Float : (format "%3f" (float (/ 1 2))) You can always convert to Float: (format "%3f" (float (/ 1 2)))
  • 我认为binding宏是并行的而不是顺序的。 请参阅: http : //clojuredocs.org/clojure_core/clojure.core/binding I believe binding macro is parallel not sequential. See: http://clojuredocs.org/clojure_core/clojure.core/binding
  • 不幸的是,你已经在表达式中使用了符号对象(apply (first a) (rest a)) 。 符号对象查找自身的值作为映射中的键: ('/ {'+ :plus '/ :slash '- :minus} :not-found) => :slash ('/ {'+ :plus '$ :dollar '- :minus} :not-found) => :not-found ('/ 1 :not-found) => :not-found ('/ 1 2) => 2 Unfortunately, you ...
  • 问题在于树有两种不同的想法。 您的树是一个图表,显示值在评估中如何渗透,但LISP正在考虑列表列表,并使用前缀表示法: '(+( - 1 2)3)也是(list +(list - 1 2)3),实际上是这棵树: + . 3 - 1 2 (-> zipped down node)为您提供第一个元素+,一个原子。 (-> zipped down down)从而给你零,因为第一个元素+是一个原子。 (-> zipped down right down node)给出你想要的减号,因为这是表达式第 ...
  • 取决于它们是否在单独的单元格中 - 如果它们是,它是一个简单的一个值超过所有值的总和(如果它们在A1,B1和C1中它将是A1/SUM($A$1:$C$1) , B1/SUM($A$1:$C$1)和C1/SUM($A$1:$C$1) ): 但是我猜这一切都在一个单元中,所以第一个比率是=LEFT(A9,FIND("|",A9,1)-2)/(LEFT(A9,FIND("|",A9,1)-2)+LEFT(RIGHT(A9,LEN(A9)-FIND("|",A9,1)),FIND("|",RIGHT(A9,LEN( ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。