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

how do indirection in value-of or select?

Subject: how do indirection in value-of or select?
From: "Mark D. Anderson" <mda@xxxxxxxxxxxxxx>
Date: Fri, 26 Feb 1999 19:43:47 -0800
xsl name mycolumn
my xml is some database metadata that includes declarations of
"domains" and "columns", among other things. "domains", for those
not into rdbms-speak, are sort of like abstract types. each
column has a domain, and each domain has its physical type.
like this:

<root>
 <domain name="email" dbtype="varchar2(100)"/>
 <domain ... />
 ...
 <table name="mytable">
   <column name="mycolumn" domain="email"/>
 </table>
 ...
</root>

now i'd like to produce an xsl style sheet that can print out
something like this:
create table mytable (
   mycolumn varchar2(100);
);

any suggestions? this obviously doesn't cut it:

<xsl:for-each select="table">
create table <xsl:value-of select="@name"/> (
 <xsl:for-each select="column">
 <xsl:value-of select="@name"/>
 <xsl:value-of select="@domain"> <!-- do what here? -->
 </xsl:for-each>
</xsl:for-each>

this doesn't work either for the tricky line:
  <xsl:apply-templates select="ancestor(root)/domain=@domain"/>

i'm willing to change the syntax of the xml if that helps,
but it does seem like xsl should have some way to do this.
macros? constants? producing elements that are then processed
again by the processor? or can xsl just not do a join?

-mda



 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.