通过XSLT将CSV转换为html [英] Convert CSV To html via XSLT

查看:58
本文介绍了通过XSLT将CSV转换为html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




只是想知道是否有人知道是否可以使用XSLT将

a CSV转换为xml?


我看过很多关于xml到CSV的例子,但是有可能以另一种方式返回

吗?


我不想使用一些外部程序或脚本来解析

如果可能的话首先使用csv


Chris

解决方案

5月24日上午11:29,Chris< chrisjohnd ... @ gmail.comwrote:





只是想知道是否有人知道是否可以使用XSLT将

a CSV转换为xml?


我见过很多关于xml到CSV的例子,但是可以用另一种方式回到
吗?


我不想使用一些外部程序或脚本来解析

如果可能的话首先使用csv


Chris



对不起,刚看到这篇关于此的帖子,随时可以删除

这一个:) :) :)


5月24日,11:29,Chris< chrisjohnd ... @ gmail.comwrote:


只是想知道是否有人知道它是否知道可以使用XSLT将

a CSV转换为xml吗?



是的,但你需要先预先处理成XML。


通常在sed中使用简单的单行程序(逗号到标签)并添加标题/

页脚根元素就足够了。


>只是想知道是否有人在那里知道是否可以使用XSLT转换


> CSV到xml?



是的,但您需要先预先处理XML。



这是另一种说不的方式。 :-)


通常在sed中使用简单的单行(逗号到标记)并添加标题/

页脚根元素就足够了。



是的,但是你已经在sed中完成了你的CVS --XML。当然,一旦

,它就是格式良好的XML,你可以通过各种方式使用XSLT。


但是XSLT只适用于XML文档。它甚至不适用于不符合XML标准的旧版本。


- Scott


Hi,

Just wondering if anyone out there knows if it is possible to convert
a CSV to xml using XSLT?

I''ve seen a lot of examples of xml to CSV, but is it possible to go
back the other way?

I don''t want to have to use some external program or script to parse
the csv first if possible

Chris

解决方案

On May 24, 11:29 am, Chris <chrisjohnd...@gmail.comwrote:

Hi,

Just wondering if anyone out there knows if it is possible to convert
a CSV to xml using XSLT?

I''ve seen a lot of examples of xml to CSV, but is it possible to go
back the other way?

I don''t want to have to use some external program or script to parse
the csv first if possible

Chris

Sorry just seen this a post about this already, feel free to remove
this one :) :) :)


On 24 May, 11:29, Chris <chrisjohnd...@gmail.comwrote:

Just wondering if anyone out there knows if it is possible to convert
a CSV to xml using XSLT?

Yes, but you need to pre-process into XML first.

Usually a simple one-liner in sed (commas to tags) and adding a header/
footer root element is adequate.


>Just wondering if anyone out there knows if it is possible to convert

>a CSV to xml using XSLT?


Yes, but you need to pre-process into XML first.

Which is another way of saying "No". :-)

Usually a simple one-liner in sed (commas to tags) and adding a header/
footer root element is adequate.

Yes, but then you''ve done your CVS --XML in sed. Of course once
it''s in well-formed XML, you can use XSLT in all sorts of ways.

But XSLT will only work on XML documents. It won''t even work on older
HTML that doesn''t conform to XML standards.

-- Scott


这篇关于通过XSLT将CSV转换为html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆