我已经阅读了XML,但如何真正使用它? [英] I've read up on XML, but how to really use it??

查看:72
本文介绍了我已经阅读了XML,但如何真正使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我是一个老程序员,他最后读了xml过去的每周b
。 xml,dtd和xsl的概念似乎很简单。

me。据我所知,xsl(作为转换的xslt)可用于将
从xml文档转换为xml数据到另一个文档中,因为模板中指定了




我见过的最好的例子之一就是将给定的xml

doc转换成html。


但是,我似乎陷入困境的是如何真正应用

xml文件。我知道它们可以用作数据持有者和配置文件

用于常规应用程序。但是你如何更直接地使用它,比如说,

从xml doc生成一个网页。


另外(这就是我的意思我真的得到了是,是否可以使用xml和xslt来编写网页。我注意到像Front Page 2003这样的

应用程序(我有时用它作为我的html编辑器)

让你制作xml文件。


从我所看到的,我可以轻松地在我的网络服务器上的文档根目录中的某个
a文件夹中创建一个.xml,.dtd和.xslt文件,但是我

真的不明白我是怎么实际打电话的来自网络浏览器的xslt(因为它实际转换了
)?是否需要

被叫从一个HTML文档,或什么?这就是我最困惑的事情,并且感谢任何帮助清理水域。


(此外,任何好的现实世界的例子一个xml + dtd + xslt会很有帮助

也好。)


-

Stan

Hi. I''m an old programmer whose been finally reading up on xml the past
week. The concepts of xml, dtd, and xsl seem pretty straight forward to
me. I understand that xsl (as xslt for transformations) can be used to
transform xml data from an xml document into another document, as
specified in the templates.

One of the best examples I''ve seen by far is transforming a given xml
doc into html.

But where I seem to be getting stuck in the mud is how to really apply
xml documents. I know they can be used as data holders and config files
for regular applications. But how do you use it more directly, to, say,
generate a webpage from an xml doc.

Also (and this is kind of what I''m really getting at) is, is it possible
to write web pages, so to speak, using xml and xslt. I noticed that such
applications like Front Page 2003 (I sometimes use it as my html editor)
let you make xml documents.

From what I can see, I can easily make an .xml, .dtd, and .xslt files in
a folder somewhere in the document root on my web server, but what I
TRULY don''t understand is how do I actually "call" the xslt (since it
does the actual transformation) from the web browser? Does it need to be
"called" from an html document, or what? This is what I''m most confused
on, and thanks for any help clearing up the waters.

(Also, any good real world examples for an xml+dtd+xslt would be helpful
too.)

--
Stan

推荐答案

Stan R.写道:
Stan R. wrote:
嗨。我是一个老程序员,他最后在过去的一周读了xml。 xml,dtd和xsl的概念对我来说似乎很简单。据我所知,xsl(用于转换的xslt)可用于将xml文档中的xml数据转换为另一个文档,如模板中指定的那样。

其中一个我到目前为止看到的最好的例子是将给定的xml
doc转换为html。


xsl的强大之处在于它可用于将任何

xml文件转换为任何其他xml文件。


但是我似乎陷入困境的是如何真正应用
xml文档。我知道它们可以用作常规应用程序的数据持有者和配置文件。但是你如何更直接地使用它,比如说,从xml doc生成一个网页。

另外(这就是我真正得到的)是是否可以使用xml和xslt来编写网页。我注意到像Front Page 2003这样的应用程序(我有时将它用作我的html编辑器)
让你制作xml文档。



您无法写入网页(至少没有任何编程支持),

但您可以让浏览器创建html输出使用

xsl。

从我所看到的,我可以轻松地在一个文件夹中创建.xml,.dtd和.xslt文件我的网络服务器上的文档根目录,但我真的不明白的是我如何实际呼叫来自网络浏览器的xslt(因为它实际转换)?它是否需要被称为被叫从一个HTML文档,或什么?这是我最困惑的事情,感谢任何帮助清理水域。
Hi. I''m an old programmer whose been finally reading up on xml the past
week. The concepts of xml, dtd, and xsl seem pretty straight forward to
me. I understand that xsl (as xslt for transformations) can be used to
transform xml data from an xml document into another document, as
specified in the templates.

One of the best examples I''ve seen by far is transforming a given xml
doc into html.
The power of xsl lies in the fact that it can be used to transform any
xml file into any other xml file.

But where I seem to be getting stuck in the mud is how to really apply
xml documents. I know they can be used as data holders and config files
for regular applications. But how do you use it more directly, to, say,
generate a webpage from an xml doc.

Also (and this is kind of what I''m really getting at) is, is it possible
to write web pages, so to speak, using xml and xslt. I noticed that such
applications like Front Page 2003 (I sometimes use it as my html editor)
let you make xml documents.

You cannot write to web pages(atleast without any programming support),
but you can make the browser to create html output on the fly using
xsl.
From what I can see, I can easily make an .xml, .dtd, and .xslt files in
a folder somewhere in the document root on my web server, but what I
TRULY don''t understand is how do I actually "call" the xslt (since it
does the actual transformation) from the web browser? Does it need to be
"called" from an html document, or what? This is what I''m most confused
on, and thanks for any help clearing up the waters.




你不要从浏览器调用xsl。一个简单的指令在

开头的xml文件中会告诉浏览器要应用哪个xsl样式表

文件。


For一个更清晰的例子见
http:// www。 captain.at/howto-xml-xsl-example.php

-Dhanvanth



You dont call the xsl from the browser. A simple directive in the
beginning of the xml file will tell the browser which xsl stylesheet
file to apply.

For a clearer example see
http://www.captain.at/howto-xml-xsl-example.php

-Dhanvanth


Stan R.写道:
Stan R. wrote:
嗨。我是一个老程序员,他最后在过去的一周读了xml。 xml,dtd和xsl的概念对我来说似乎很简单。据我所知,xsl(用于转换的xslt)可用于将xml文档中的xml数据转换为另一个文档,如模板中指定的那样。

其中一个到目前为止,我看到的最好的例子是将给定的xml
doc转换为html。

但是我似乎陷入困境的是如何真正应用
xml文档。我知道它们可以用作常规应用程序的数据持有者和配置文件。但是,如何更直接地使用它,比如说,从xml doc生成一个网页。


您可以编写一个XSLT转换来执行此操作,因为您已经在上一段中提到了



另外(和这就是我真正得到的东西是,是否可以编写网页,可以这么说,使用xml和xslt。我注意到像Front Page 2003这样的应用程序(我有时将它用作我的html编辑器)
让你制作xml文档。


这是可能的,但是对浏览器内XML和XSLT的支持是不完整的。

强烈建议服务器端转换。

从我所看到的,我可以轻松地在我的网络服务器上的文档根目录中的某个文件夹中创建一个.xml,.dtd和.xslt文件,但是我真的很好我不明白我是怎么实际打电话的来自网络浏览器的xslt(因为它实际转换)?


请参阅常见问题解答: http:/ /xml.silmaril.ie/authors/style/

是否需要
调用从一个HTML文档,或什么?这是我最困惑的事情,感谢任何帮助清理水域。


必须在XML文档中引用样式表。浏览器

获取它并应用它来执行转换。

(此外,xml + dtd + xslt的任何好的真实世界示例都会有所帮助
也好。)


请参阅常见问题解答中的链接(这一切都是这样做的)。
http://xml.silmaril.ie/admin/availability/


/// Peter
Hi. I''m an old programmer whose been finally reading up on xml the past
week. The concepts of xml, dtd, and xsl seem pretty straight forward to
me. I understand that xsl (as xslt for transformations) can be used to
transform xml data from an xml document into another document, as
specified in the templates.

One of the best examples I''ve seen by far is transforming a given xml
doc into html.

But where I seem to be getting stuck in the mud is how to really apply
xml documents. I know they can be used as data holders and config files
for regular applications. But how do you use it more directly, to, say,
generate a webpage from an xml doc.
You can write an XSLT transformation to do this, as you already mention
in the previous paragraph.
Also (and this is kind of what I''m really getting at) is, is it possible
to write web pages, so to speak, using xml and xslt. I noticed that such
applications like Front Page 2003 (I sometimes use it as my html editor)
let you make xml documents.
It''s possible, but support for in-browser XML and XSLT is patchy.
Server-side transformation is strongly recommended.
From what I can see, I can easily make an .xml, .dtd, and .xslt files in
a folder somewhere in the document root on my web server, but what I
TRULY don''t understand is how do I actually "call" the xslt (since it
does the actual transformation) from the web browser?
See the FAQ: http://xml.silmaril.ie/authors/style/
Does it need to be
"called" from an html document, or what? This is what I''m most confused
on, and thanks for any help clearing up the waters.
The stylesheet has to be referenced in the XML document. The browser
fetches it and applies it to perform the transformation.
(Also, any good real world examples for an xml+dtd+xslt would be helpful
too.)
See the links in the FAQ (it''s all done that way).
http://xml.silmaril.ie/admin/availability/

///Peter



dh **** ***@gmail.com 写道:
Stan R.写道:
Stan R. wrote:
嗨。我是一个老程序员,上周他终于读了xml。 xml,dtd和xsl的概念看起来非常直接向我发展。据我所知,xsl(用于转换的xslt)
可用于将xml文档中的xml数据转换为另一个
文档,如模板中所指定。

其中一个我到目前为止看到的最好的例子是将给定的xml
doc转换为html。
Hi. I''m an old programmer whose been finally reading up on xml the
past week. The concepts of xml, dtd, and xsl seem pretty straight
forward to me. I understand that xsl (as xslt for transformations)
can be used to transform xml data from an xml document into another
document, as specified in the templates.

One of the best examples I''ve seen by far is transforming a given xml
doc into html.



xsl的强大之处在于它可用于转换任何
xml文件到任何其他xml文件中。



The power of xsl lies in the fact that it can be used to transform any
xml file into any other xml file.

但我似乎陷入困境的是如何真正地应用xml文件。我知道它们可以用作常规应用程序的数据持有者和配置文件。但是你如何更直接地使用它,比如说,从xml doc生成一个网页。

另外(这就是我真正得到的)是是否可以编写网页,可以这么说,使用xml和xslt。我注意到像Front Page 2003这样的应用程序(我有时使用它作为我的html编辑器)可以让你创建xml文档。
But where I seem to be getting stuck in the mud is how to really
apply xml documents. I know they can be used as data holders and
config files for regular applications. But how do you use it more
directly, to, say, generate a webpage from an xml doc.

Also (and this is kind of what I''m really getting at) is, is it
possible to write web pages, so to speak, using xml and xslt. I
noticed that such applications like Front Page 2003 (I sometimes use
it as my html editor) let you make xml documents.



你不能写入web页面(至少没有任何编程支持),但你可以让浏览器使用xsl在
上创建html输出。


You cannot write to web pages(atleast without any programming
support), but you can make the browser to create html output on the
fly using xsl.

从我能看到的,我可以轻松地在我的网络服务器上的文档根目录中的某个文件夹中创建一个.xml,.dtd和.xslt
文件,但我真的不明白我是怎么做的实际上是呼叫
xslt(因为它实际转换)来自网络浏览器?
是否需要调用?从一个HTML文档,或什么?这是我最困惑的事情,感谢任何帮助清理
水域。
From what I can see, I can easily make an .xml, .dtd, and .xslt
files in a folder somewhere in the document root on my web server,
but what I TRULY don''t understand is how do I actually "call" the
xslt (since it does the actual transformation) from the web browser?
Does it need to be "called" from an html document, or what? This is
what I''m most confused on, and thanks for any help clearing up the
waters.



你不要从浏览器调用xsl。在xml文件开头的一个简单指令将告诉浏览器要应用哪个xsl stylesheet
文件。

有关更清晰的示例,请参阅
http://www.captain.at/howto-xml-xsl-example。 php




非常感谢。


-

Stan



Thank you very much.

--
Stan


这篇关于我已经阅读了XML,但如何真正使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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