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

Re: Searching in Sub-children from an Array

Subject: Re: Searching in Sub-children from an Array
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Tue, 12 Dec 2006 21:07:15 +0100 (CET)
Re:  Searching in Sub-children from an Array
Houman Khorasani wrote:

  Hi

> Just out of curiosity; do you have a simple example how this
> should work as meta data?  Sounds interesting...

  I'm not sure what you mean.  Do you want a meta-stylesheet sample? 
The principle is verry simple: you have an XML document (looking alike
XSLT or not) and your stylesheet transform it itself in a stylesheet. 
So a generated stylesheet, that can be in turn used to transform other
XML input.

  I think it was the subject of the Mike's talk at XML 2006.  By the
way Mike, do you plan to make some paper available from your talk?

  Here is a simple example, not verry usefull, but giving the idea:

(drkm)[27] ~/xslt/tests$ cat meta-stylesheet.xsl
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:x_="http://www.w3.org/1999/XSL/TransformAlias"
    version="2.0">

  <xsl:namespace-alias
      stylesheet-prefix="x_"
      result-prefix="xsl"/>

  <xsl:output indent="yes"/>

  <xsl:template match="/">
    <x_:stylesheet version="2.0">
      <x_:template match="/">
        <html>
          <head>
            <title>...</title>
          </head>
          <body>
            <xsl:apply-templates select="page/para"/>
          </body>
        </html>
      </x_:template>
    </x_:stylesheet>
  </xsl:template>

  <xsl:template match="para">
    <x_:for-each select="{ @select }">
      <p>
        <x_:value-of select="."/>
      </p>
    </x_:for-each>
  </xsl:template>

</xsl:stylesheet>

(drkm)[28] ~/xslt/tests$ cat meta-stylesheet.xml
<page>
  <para select="any XPath expression selecting nodes"/>
</page>

(drkm)[29] ~/xslt/tests$ saxon meta-stylesheet.xml \
                               meta-stylesheet.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
   <xsl:template match="/">
      <html>
         <head>
            <title>...</title>
         </head>
         <body>
            <xsl:for-each select="any XPath expression selecting
nodes">
               <p>
                  <xsl:value-of select="."/>
               </p>
            </xsl:for-each>
         </body>
      </html>
   </xsl:template>
</xsl:stylesheet>

(drkm)[30] ~/xslt/tests$

  Regards,

--drkm






















	

	
		
___________________________________________________________________________ 
Dicouvrez une nouvelle fagon d'obtenir des riponses ` toutes vos questions ! 
Profitez des connaissances, des opinions et des expiriences des internautes sur Yahoo! Questions/Riponses 
http://fr.answers.yahoo.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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
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-2007 All Rights Reserved.