Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 21st, 2007, 09:36 PM
Authorized User
 
Join Date: Jul 2003
Location: atlanta, ga, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic html file call in XSL

Hi all

Can someone help me with the below issue:

I need to call a html file from a xsl, where the html file
name keeps changing ie., I will need to read the html file name
on a runtime basis when the xsl transformation happens.

Thanks
suri.

Reply With Quote
  #2 (permalink)  
Old June 22nd, 2007, 03:34 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I don't know what you mean by "calling" an HTML file. One normally talks about calling a program, but an HTML file is data, not a program. What do you actually want to do with the HTML?

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old June 22nd, 2007, 06:51 AM
Authorized User
 
Join Date: Jul 2003
Location: atlanta, ga, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Michael Kay

Sorry for not being clear enough.

Lets assume an example xxx.html. This xxx.html has a table tag with datas in it.

Now, what I want is, with in a XSL file at a particular place I want to show the xxx.html data.
Is that possible and how?

Remember xxx.html the file name will only be know at the time of XSL transformation.

thanks
Suri


Reply With Quote
  #4 (permalink)  
Old June 22nd, 2007, 07:28 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Provided the HTML file holds well-formed XML you can do

<xsl:copy-of select="document($x)"/>

where $x is a variable holding the URI, for example "xxx.html".

If the HTML isn't well-formed XML, one option is to convert it first using the W3X JTidy utility. With some processors you can invoke this on the fly, by calling it from a URIResolver that's invoked when document() is called. An alternative with Saxon is to nominate John Cowan's TagSoup as your XML parser.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #5 (permalink)  
Old June 22nd, 2007, 08:03 AM
Authorized User
 
Join Date: Jul 2003
Location: atlanta, ga, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot, Michael.

<xsl:copy-of select="document($x)"/>,
is the one I was looking for.
That worked for me.

Thanks once again,
Suri

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass the dynamic XML file name to XSL jle XSLT 3 March 13th, 2008 04:20 PM
differnce between xsl:apply-templates and xsl:call chandu.mca007 XSLT 2 June 12th, 2007 04:12 AM
Re: Dynamic html tables with xsl? purple XSLT 0 November 2nd, 2005 12:01 PM
How Can I call a HTML file from a servlet? alf.guzman Servlets 3 January 24th, 2005 04:51 AM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM



All times are GMT -4. The time now is 04:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.