[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: convert XML to HTML

  • From: "Mukul Gandhi" <gandhi.mukul@g...>
  • To: "=?UTF-8?Q?Carlos_Narv=C3=A1ez?=" <crakup@g...>
  • Date: Sun, 21 Oct 2007 13:35:59 +0530

Re:  convert XML to HTML
You can use XSLT 2.0 for this requirement.

Following is an XSLT stylesheet processing a directory, containing XML
files (of pattern test*.xml).

The stylesheet uses the XPath 2.0 'collection' function, and the XSLT
2.0 'result-document' instruction.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">

 <xsl:output method="html" />

 <xsl:variable name="docs"
select="collection('file:///E://xml//xsleg//xslt?select=test*.xml')"
/>

 <xsl:template match="/">
   <xsl:for-each select="$docs">
     <xsl:result-document href="{position()}.html">
       <html>
         <head>
           <title/>
           <body>
             <!-- populate HTML -->
           </body>
         </head>
       </html>
     </xsl:result-document>
   </xsl:for-each>
 </xsl:template>

</xsl:stylesheet>

This is tested with Saxon 8.9.9.2J.

On 10/21/07, Carlos Narváez <crakup@g...> wrote:
> I need to convert a receiving XML into HTML, and save it as html.
> This has to be done as the application where it later shall be used
> does not support xml format (only html, tiff and pdf).
> So with the xsl I need to run through a directory, and convert all xml
> into html.
> Is there a freeware out there that handles this?
> Or does anyone have a good tip?
>
> --
> Carlos Narváez
> http://www.fondosdepantalla.com.mx


-- 
Regards,
Mukul Gandhi


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.