Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Alright this seems like a stupid question but I can't figure it out. I'm writing an XSLT file to translate an XML document into an XHTML document. I've used both Visual Studio and XML Notepad 2007 to preview the results of my XSLT file, but now I want to actually write out a real XHTML file so I can see how it looks in other browsers.

Neither Visual Studio or XML NotePad have an obvious way to save the preview. Am I missing something. Obviously the file is getting created because something is being previewed, but I need to know where that file is being created or better yet choose its location.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
670 views
Welcome To Ask or Share your Answers For Others

1 Answer

You have two options:

  1. Let the browser do it. Pass the XML with a reference to the XSLT and the browser (IE 6 or lower might have problems) will render it as (X)HTML:

    <?xml-stylesheet type="text/xsl" href="http://www.example.com/my-xslt.xsl" ?>

  2. Do it server-side. Most languages have methods for accepting XSLT and XML data, then outputting (X)HTML. Here are some options:

alt text


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...