简体   繁体   English

是否可以使用 Go 解析完整的 CCDA xml 文件?

[英]Is it Possible to Parsing a complete CCDA xml file Using Go?

I would like to Parse an complete CCDA XML file by using any library available in Go.我想使用 Go 中可用的任何库来解析完整的 CCDA XML 文件。 I tried to parse the CCDA XML file by using the https://godoc.org/github.com/clbanning/mxj library.我尝试使用https://godoc.org/github.com/clbanning/mxj库来解析 CCDA XML 文件。 In this one we need to go to specific path and parse the data but I want to parse the different scetions at a time by using the package or a library.在这个我们需要 go 到特定路径并解析数据,但我想使用 package 或库一次解析不同的部分。 I googled and ended up with no answers.我用谷歌搜索并最终没有答案。 It would be great if you guys help me.如果你们能帮助我,那就太好了。

One thing you can try is to use a DOM library to parse the CCDA, and work on the resulting DOM model.您可以尝试的一件事是使用 DOM 库来解析 CCDA,并处理生成的 DOM model。 There are several of them, one being https://github.com/lestrrat-go/libxml2 , which uses the libxml2 library.其中有几个,一个是https://github.com/lestrrat-go/libxml2 ,它使用 libxml2 库。

xmlquery to parse any XML document and extract any you want to data by XPath. xmlquery解析任何 XML 文档并通过 XPath 提取任何您想要的数据。

I don't know Go, but CCDA is XML, so you can transform it using XSLT.我不知道Go,但是CCDA是XML,所以你可以使用XSLT对其进行改造。 I would assume Go has a way of allowing you to do that.我会假设 Go 有办法让你这样做。

There are many CCDA xsl examples - it depends what you want the result to be.有许多 CCDA xsl 示例 - 这取决于您想要的结果。

eg https://github.com/hl7/cda-core-xsl例如https://github.com/hl7/cda-core-xsl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM