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

Re: Applying external XML

Subject: Re: Applying external XML
From: Israel Viente <israel.viente@xxxxxxxxx>
Date: Tue, 2 Feb 2010 20:40:07 +0200
Re:  Applying external XML
Try to use absolute paths in menu.xml or do something like:

<xsl:for-each select="item-uri">
  <xsl:variable name="fileName" select="normalize-space(.)"/>
  <xsl:variable name="infile"
select="concat('file:///',$infilepathname, '/', $fileName)" />
  <xsl:apply-templates select="doc($infile)"/>
</xsl:for-each>

Israel

On Tue, Feb 2, 2010 at 8:29 PM, Rob Belics <rob_belics@xxxxxxxxxxx> wrote:
>
> I'm trying to import xml data from other files on a remote server and
> apply templates to that data. Everything in my "restaurant.xsl" works
> and I've retrieved "menu.xml" which contains links (item-uri) to other
> xml files (item.xml) that contain more info about each item for sale on
> the menu (tuna and roast beef). However, I'm having problems trying to
> import the item.xml data.
>
> I tried <xsl:apply-templates select="document()" /> in between the
> 'for-each' with various combinations of xpath for the document() but
> that hasn't gotten results I need.
>
> restaurant.xsl:
> <xsl:template match="menu">
>        <menu>
>                <xsl:for-each select="item-uri">
> <!-- What goes here? Should I be using 'for-each'? -->
>                </xsl:for-each>
>        </menu>
> </xsl:template>
>
> menu.xml:
> <menu>
>        <item-uri>tuna.xml</item-uri>
>        <item-uri>roast-beef.xml</item-uri>
> </menu>
>
> item.xml:
> <order>
>                <size>
>                        <name>Tuna</name>
>                        <price>5.00</price>
>                </size>
> </order>

Current Thread

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
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.