Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 31st, 2013, 11:05 AM
Registered User
 
Join Date: May 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default xsl import - selecting rows by rowset id

Greetings

i´m trying to import some online cached xml sheets into a filemaker database via xsl

XML scheme:


<node1>
<node2>
<rowset name=rowsetname1>
<row id=1 > // various attribs in here are safed into first table // primarykey = id // second table should get this, too
<rowset>
<row attrib1=x attrib2=y/> // all attribs in these rows should be safed in second table also refered by id from above so: id + attribs from one row = 1 DS in table
<row attrib1=k attrib2=f/>
<row attrib1=h attrib2=d/>
</rowset>
</row>
<row id=2>
<rowset>
<row attrib1=x attrib2=y/>
<row attrib1=k attrib2=f/>
<row attrib1=h attrib2=d/>
</rowset>
</row>
<row id=3>
<rowset>
<row attrib1=x attrib2=y/>
<row attrib1=k attrib2=f/>
<row attrib1=h attrib2=d/>
</rowset>
</row>
</rowset>
<rowset name=rowsetthatgetsnotselected>
...
</rowset>
</node2>
</node1>


currently my attemp to this is (as im new to xsl):

fields in the table the data is imported to: ID | ATTRIB1 | ATTRIB2 | ...



XSL (current attemp - table remains empty after import:


//get rowset by name
<RESULTSET FOUND="">
<xsl:for-each select="node1/node2/rowset[@name='rowsetnamedenichbrauche']/row">">
<ROW MODID="0" xmlns="http://www.filemaker.com/fmpxmlresult">

// get attribute id into var - loop through rows
<xsl:for-each select="@id">
<xsl:variable name="var_id" select="." />

// as soon as var_id contains a value (and bevore looping to the next row) select only the child rows of the row where id=var_id
<xsl:choose>
<xsl:when test="self::node()[@id='$var_id']">

// and import every attribute in the rows into its ds in the table
<xsl:for-each select="self::node()/rowset/row">">
<ROW MODID="0" xmlns="http://www.filemaker.com/fmpxmlresult">

<xsl:for-each select="@*">

// bevore the attribut values are passed the var_id value should be imported so the ds gets the desired format (id, attrib1, attrib2, ...)

???????

<COL><DATA><xsl:value-of select="."/></DATA></COL>
</xsl:for-each>

</ROW>
</xsl:for-each>
</xsl:when>
</xsl:choose>

</xsl:for-each>
</ROW>
</xsl:for-each>
</RESULTSET>


thank you very much for any suggestions





Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting Rows programmatically in a D.G.V. liamfitz BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 0 November 13th, 2009 07:38 PM
Selecting rows for Report stealthdevil Access VBA 10 June 2nd, 2006 04:09 PM
Selecting multiple rows in a flexgrid dfbosse VB How-To 2 May 23rd, 2006 12:18 AM
selecting rows returned by executing a SP dsekar_nat SQL Server 2000 4 May 11th, 2006 11:12 AM
Sporadic problem with Oracle selecting SEQUENCE ID bluefossil Oracle ASP 0 April 6th, 2006 05:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.