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

copying variables and bits of XML databases for XSL pr

Subject: copying variables and bits of XML databases for XSL processing
From: "Antoine Quint, Knowscape://" <antoine@xxxxxxxxxxxxx>
Date: Thu, 19 Apr 2001 01:13:13 +0200
xsl db xml
Hello,

I've been toying with this problem for a couple of days and I don't know if
I can be focussed about it anymore. Please tell me if this doesn't make any
sense.

I've got a stylesheet called "vars.xsl" where I set variables that reference
XML databases, like that:

  <xsl:variable name="dbWNc"
select="document('/whats_new/collection/db.xml')"/>
  <xsl:variable name="dbWNj" select="document('/whats_new/jeans/db.xml')"/>

and so on...

I always import this stylesheet through <xsl:import/>.

One of my stylesheets need to copy one the $dbWNc and $dbWNj variables in
another variable according to which section we're in. Here's the code I
wanted to use:

  <xsl:variable name="current_db">
    <xsl:if test="$collection = 'collection'"><xsl:copy-of
select="$dbWNc"/></xsl:if>
    <xsl:if test="$collection = 'jeans'"><xsl:copy-of
select="$dbWNj"/></xsl:if>
  </xsl:variable>

where $collection held the "section" information. This doesn't work since
when I try to access my new variable like this for example, I get an
"Unspecified error" from MSXML 3.0sp1:

<xsl:variable name="items" select="count($current_db//item)"/>

Anybody knows a way around this? Is this related to my code or the processor
(MSXML 3.0sp1)? I would like to avoid call-templates and with-params as much
as possible. For reference, here's what the "/whats_new/collection/db.xml"
document looks like.

<?xml version="1.0" encoding="iso-8859-1"?>

<db>
  <item>
    <thumb width="158" height="115" weight="5603"/>
    <pop width="482" height="350" weight="30576"/>
  </item>
  <item>
    <thumb width="145" height="115" weight="5039"/>
    <pop width="442" height="350" weight="15408"/>
  </item>
</db>

antoine
_______________________________________________________________________
Antoine Quint <antoine@xxxxxxxxxxxxx> -- eXtensible developer
k n o w s c a p e : // venture knowledge agency www.knowscape.com


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


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.