如何使用xslt在xml到html转换后保留XML标记 [英] How to preserve XML tags after xml to html transformation using xslt

查看:95
本文介绍了如何使用xslt在xml到html转换后保留XML标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在使用xslt将xml转换为html时,我不想丢失xml标签。我想保留它。


转换为html并在浏览器中显示后,如果您正确点击并查看源代码,xml标签将会存在,但它会在浏览器中显示内容为html。但是在转换之后,当我在文本编辑器中显示时,xml标签就会丢失。


在这方面可以有人帮助我。


问候,

Malathi

解决方案

为什么你希望XSLT之后的原始XML代码可用? (除了你的HTML文档无效之外......)


也许文本编辑器只是忽略了XML .....


< blockquote>在文本编辑器中嵌入转换后的html后,如果我将修改内容

并保存,则必须将更改再次保存到同一个xml文件中。如果保留了xml标记,我们就不需要再做任何工作了。这就是我所有的工作都将完成。

@Dormilich


是什么样的变化是(文本更改,结构更改)?也许一个代码示例可以帮助我理解。


你想要做什么(基本上)

[xml 1] =(XSLT)=> [html 1] =(编辑)=> [html 2] =(?)=> [xml 1''] ???

Hi,

while trasforming xml to html using xslt, i dont want to lose xml tags.I want to preserve it.

After transforming to html and displaying in browser and if you are right clicking and viewing the source, xml tags will be there as it is but it will display teh content as html in browser. But after transforming, when i am displaying in text editor, the xml tags are getting lost.

Could anybody help me in this regard.

Regards,
Malathi

解决方案

why do you want the original XML code to be available after XSLT? (besides the fact, that your HTML document will be invalid...)

maybe the text editor just ignores the XML.....


After embedding the transformed html in text editor, if i will modify the content
and save it, it has to save the changes again to the same xml file. If xml tags are getting preserved, we no need to do any more work on that. thats all my work will be done.

@Dormilich


what kind of changes are that (text changes, structure changes)? maybe a code example could help me understand.

you want to do (basicly)
[xml 1] =(XSLT)=> [html 1] =(editor)=> [html 2] =(?)=> [xml 1''] ???


这篇关于如何使用xslt在xml到html转换后保留XML标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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