Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , ,

Sponsored Links



Is there a way link xsl to xml file ?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 25-10-2008
Samarth's Avatar
Member
 
Join Date: Aug 2006
Posts: 124
Is there a way link xsl to xml file ?

I know u can link an xml file to an xsl file by putting a stylesheet
declaration in the xml file.

Is there a way to do the opposite ?, is there a declaration I can put in
the xsl file that means I can browse to it as if I was browsing the xml
file with a stylesheet declaration ?.

any help appreciated.
Reply With Quote
  #2  
Old 25-10-2008
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,976
Re:link xsl to xml file ?

When you say "browse to it" do you mean with a web browser, retrieving
via HTTP, or with a file browser (aka directory manager like My Computer) which just looks at files on a local or shared disk?

If you are using XSLT2, it might be possible to open the stylesheet and
have a document() XPath call at the top level which would open the
required document.
It's also possible to simulate this kind of action using an XML server
like Cocoon.

I'm interested to know why you want to do it this way, though.
Reply With Quote
  #3  
Old 25-10-2008
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
Re: Is there a way link xsl to xml file ?

I thnink it should be possible using XInclude [1]:

-----proxy.xml
<?xml version="1.0"?>
<?xml-stylesheet href="sheet.xsl" type="application/xml"?>
<xi:include xmlnsi="http://www.w3.org/2001/XInclude"
href="original.xml"/>
-----proxy.xml--

But I don't think browsers support it.
Reply With Quote
  #4  
Old 17-03-2010
Member
 
Join Date: Mar 2010
Posts: 1
Re: Is there a way link xsl to xml file ?

I am having similar issue but i would like to know how to link the xsl file with the xml document in browser runtime.
Reply With Quote
  #5  
Old 17-03-2010
Modifier's Avatar
Member
 
Join Date: Jan 2008
Posts: 1,502
Re: Is there a way link xsl to xml file ?

Hey you can not link xsl to xml file, But you can transform XML into XHTML using XSLT.
Correct Style Sheet Declaration is as follows:
The root element that declares the document to be an XSL style sheet is <xsl:stylesheet> or <xsl:transform>.

The correct way to declare an XSL style sheet is:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.localhost.org/1999/XSL/Transform">
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Is there a way link xsl to xml file ?"
Thread Thread Starter Forum Replies Last Post
How To Open A File Next To The Link You Clicked. BrooksyFC Software Development 2 16-08-2011 08:45 PM
Getting config file error on D-Link DIR-652 Donoho Networking & Security 3 02-07-2011 07:15 AM
How to link CSS into the HTML file? Zhankana_n Software Development 5 23-12-2009 03:02 PM
Save As saves link to WMV instead of video file mlichtel MediaCenter 3 22-05-2009 04:40 AM
help me to link an swf file Fastrohit Customize Desktop 3 19-08-2008 03:25 PM


All times are GMT +5.5. The time now is 11:24 AM.