[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] external files


Subject: Re: [xsl] external files
From: Mulberry Technologies List Owner <xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 11 Jul 2001 18:48:27 -0400

>From: "Robert Koberg" <rob@xxxxxxxxxx>
>To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>References: <236CA276C223D5118D9F00D0B73E811E054892@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
>Subject: Re: [xsl] external files
>Date: Wed, 11 Jul 2001 07:55:27 -0700
>MIME-Version: 1.0
>
>this is off the top of my head - no testing - hopefully it will give you the
>info you need - should work...
>_______________________________
>
>config.xml -- some sample XML
>-----------------------
><folder name="" id="root">
>   <page id="index_en_us">
>      <xml filref="boo_en_us.xml"/>
>   </page>
>   <page id="index_en_uk">
>      <xml filref="boo_en_us.xml"/>
>   </page>
>   <page id="index_es_la">>
>      <xml filref="boo_en_us.xml"/>
>   </page>
>   <folder name="products" id="etc...>
>      <folder name="thiskindofproduct">
>        etc...
>      </folder>
>   </folder
></folder>
>--------------------------------------------------
>wrapper.xsl -- I send down the page ID as a parameter from a servlet (but
>there are other ways) and transform the above XML with the below XSL:
>
><xsl:param name="page-id"/>
>
><!-- select all so you can build path to page from folder names -->
><xsl:template match="//*">
>   <xsl:variable name="path">
>       <xsl:call-template
>name="get-path-to-file-from-ancestor-folder-names-or-however">
>            <xsl:with-param name="page-id" select="$page-id"/>
>       </xsl:call-template>
>   </xsl:variable>
>   <xsl:apply-templates select="page[@id=$page-id]">
>        <xsl:with-param name="$path" select="$path"/>
>   </xsl:apply-templates>
></xsl:template>
>
><xsl:template match="page">
>    <xsl:param name="path"/>
>       <xsl:apply-templates select="document(concat($path,xsml/@fileref)"/>
></xsl:template>
>
><xsl:template match="root-of-pulled-page">
>   <html>
>   blah blah
>   </html>
></xsl:template>
>--------------------------------
>
>hth,
>Rob
>
>----- Original Message -----
>From: "Mike Lamb" <m@xxxxxxxxxxxxxxxxxxxxx>
>To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
>Sent: Wednesday, July 11, 2001 6:35 AM
>Subject: [xsl] external files
>
>
>> Thanks all for your comments. I think I can simplify my inquiry:
>>
>> I need to be able to import an XML file specified in my source document
>and
>> process it using templates in my ORIGINAL xsl file. I suspect that the
>> document() function allows me to do exactly this, but I am very unclear on
>> the mechanics. Any thoughts on this simplified problem?
>>
>>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>>


-- 
======================================================================
B. Tommie Usdin                        mailto:btusdin@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com  
17 West Jefferson Street                           Phone: 301/315-9631
Suite 207                                    Direct Line: 301/315-9634
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML              
======================================================================

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords