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

Re: Solved: Inserting data from secondary XML document

Subject: Re: Solved: Inserting data from secondary XML document ...
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 3 Apr 2001 09:59:35 +0200 (MET DST)
inserting rows in xml file
> Looks like I solved it.
> 
> <xsl:template match="string1">
>   <xsl:variable name="temp" select="."/>
>   <xsl:variable name="value">
>     <xsl:value-of
> select="document('second.xml')//db_column_name1[.=$temp]/../@num"/>
>   </xsl:variable>
>   <xsl:value-of select="$value"/>
> </xsl:template>

As always: there's more than one way to do it.
To my mind the following is more "natural":

<xsl:template match="string1">
   <xsl:value-of
        select="document('second.xml')/*/row[db_column_name1=current()]/@num" />
</xsl:template>

Cheers,
Oliver


> -----Original Message-----
> From: Ough, Cameron 
> Sent: Monday, April 02, 2001 6:15 PM
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject: Inserting data from secondary XML document ...
> Importance: High
> 
> 
> All right, I would be extremely grateful if someone could help me with this
> problem.
> 
> I'm exporting data to two separate files . 
> 
> What I am trying to do is, when transforming one xml file, I need to check
> the row id of that value in the separate XML file, and replace the string
> value with the row id from the second XML file.
> The second file has a format like this (Oracle XSU):
> 
> <rowset>
> 	<row num='1'>
> 		<db_column_name1> value </db_column_name1>
> 	</row>
> 	<row num='2'>
> 		<db_column_name1> value </db_column_name1>
> 	</row>
> <rowset>
> 
> I've tried (unsuccessfully) to use the something like the following to
> retrieve the row num attribute value from the remote file into a local
> variable, with no luck.
> 
> <xsl:template match="string1">
> <xsl:variable name="temp">
> 	<xsl:value-of
> select="document('second.xml')/*/row/@num[child::*=.]"/>
> </xsl:variable>
> </xsl:template>
> 
> Can someone put me on track?
> 
> Thanks,
> - Cameron


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


 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.