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

conditional <sql:column> ?!

Subject: conditional <sql:column> ?!
From: "Szabo, Patrick (LNG-VIE)" <patrick.szabo@xxxxxxxxxxxxx>
Date: Tue, 23 Sep 2008 12:17:39 +0200
 conditional <sql:column> ?!
Hi,

I4m using xslt 2.0 and saxon 9

What i want to do is insert data into a database (which works already), but 1
column should not always be inserted.
This is what i have right now:

<sql:insert connection="$connection" table="concat($art,'_',$gericht)">
<sql:column name="DOKNR"
select="normalize-space(replace(/ris:result/ris:data/ris:risdokument/ris:meta
daten/ris:technisch/ris:id,'_','/'))"/>
<sql:column name="Datum"
select="normalize-space(replace(/ris:result/ris:data/ris:risdokument/ris:meta
daten/ris:judikatur/ris:datum, '-', ''))"/>
<sql:column name="Filename"
select="normalize-space(concat(/ris:result/ris:data/ris:risdokument/ris:metad
aten/ris:technisch/ris:id/text(), '.xml'))"/>
<sql:column name="Gesnr"
select="normalize-space(string(/ris:result/ris:data/ris:risdokument/ris:metad
aten/ris:judikatur/ris:gz/child::*[$count]))"/>


<xsl:if
test="/ris:result/ris:data/ris:risdokument/ris:metadaten/ris:technisch/ris:or
gan/text()='OGH' and
/ris:result/ris:data/ris:risdokument/ris:metadaten/ris:judikatur/ris:doktyp='
T'">
<sql:column name="SZ" select="concat('SZ
',replace(substring-after(normalize-space(/ris:result/ris:data/ris:risdokumen
t/ris:dokumentliste/ris:hauptdokument/ris:inhalt/ris:daten/ris:xml/ris:nutzda
ten/ris:abschnitt[1]/ris:fzinhalt[@typ='p']/ris:absatz), 'Seite '), ' von ',
'/'))"/>
</xsl:if>
</sql:insert>

This does not work because there is no xsl:if allowed in sql:insert and no
sql:column in xsl:if.

How can i accomplish a conditional sql:column ?!

Thanks already !

regards

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.