| Author |
Message |
   
Cocanada
Legend Username: Cocanada
Post Number: 48167 Registered: 01-2008 Posted From: 173.186.242.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 02:38 pm: |
     |
Just4fun:bpel lo
ilaati kiska miska constraintlu naaku teliyavu sadharanam ga ayite nee req ki asalu position() function akkarledu |
   
Just4fun
Legend Username: Just4fun
Post Number: 30901 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 02:22 pm: |
     |
Cocanada:indulo for-each paina, if lopala enduku pettaav ani
Good question Cokesh.. evarikanna aa doubt vastadi anukunna nuvvu adigesav. bpel lo 1 for each unnapudu andulo inko element add cheyali ante inko for each vaadi add cheyali. other ways unnai emo theliyadu std gaa ee procedure follow avutuntam |
   
Cocanada
Legend Username: Cocanada
Post Number: 48161 Registered: 01-2008 Posted From: 173.186.242.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 02:17 pm: |
     |
Just4fun:
vuncl.. db automatically blocking some code. my kochen is xsl:for-each select **/DepositCode" xsl:if test='**/Books/Seq = "1"' indulo for-each paina, if lopala enduku pettaav ani |
   
Just4fun
Legend Username: Just4fun
Post Number: 30899 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 02:15 pm: |
     |
Cocanada:<xsl:for-each> ee line first enduku pettaavu?
to iterate over books nodes .. If anedi just add on to books/book/codes. If base chesukoni extra deposit code add cheyadaniki |
   
Cocanada
Legend Username: Cocanada
Post Number: 48157 Registered: 01-2008 Posted From: 173.186.242.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 02:03 pm: |
     |
Just4fun:
<xsl:for-each> ee line first enduku pettaavu? this should be inside the if |
   
Just4fun
Legend Username: Just4fun
Post Number: 30898 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 01:31 pm: |
     |
Emc2:
Cocanada:
 |
   
Just4fun
Legend Username: Just4fun
Post Number: 30897 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 01:31 pm: |
     |
Emc2:http://stackoverflow.com/questions/9608432/incrementing-and- checking-the-counter-variable-in-xslt
Uncle nenu try cheyaledu naa case ki suit avvadu but little bit tweak chesa if condition using Position() function use cheste work avutondi. very first for each appudu variable(varPos) declare chesi position() value ni assign chesa xsl:if test='../Books/Seq[$varPos] = "1"' petta if condition lo enni sarlu loop repeat aina seq=1 unnapude add avotondi. |
   
Emc2
Legend Username: Emc2
Post Number: 36655 Registered: 03-2008 Posted From: 108.48.4.211
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 01:11 pm: |
     |
Just4fun:
http://stackoverflow.com/questions/9608432/incrementing-and- checking-the-counter-variable-in-xslt |
   
Just4fun
Legend Username: Just4fun
Post Number: 30896 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 12:58 pm: |
     |
Cokesh, Try chesa same results as in post#30893 Reason: 1 text '1' text kadu if condition work avutondi perfect ga but very beging lo unde for each loop run avutunnadu every time if condition pass avutondi as this if condition is looking entire nodes with seq=1. If condition ni entire nodes chudakunda current node ki matrame restrict cheste problem solve avuddi but how ? |
   
Just4fun
Legend Username: Just4fun
Post Number: 30895 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 12:33 pm: |
     |
Cocanada:xsl:if test="normalize-space(../../seq/text()="'1'")
let me test wit this..work avvadu anukuntunna. |
   
Cocanada
Legend Username: Cocanada
Post Number: 48155 Registered: 01-2008 Posted From: 173.186.242.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 12:23 pm: |
     |
Just4fun:
1 is text put it in single quotes '1' |
   
Just4fun
Legend Username: Just4fun
Post Number: 30894 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 12:23 pm: |
     |
Emc2:create one more variable and add for first time in the loop and turn off the flag
EMC raja, xslt lo variable increment option ledu ..each variable is like constant so adi kudaraledu. |
   
Just4fun
Legend Username: Just4fun
Post Number: 30893 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 12:21 pm: |
     |
Cocanada:nee xsl copy paste cheyyi.
https://drive.google.com/file/d/0BxqjphPlJAC-ZHdjZjFROUpmOEk /view?usp=sharing above xslt giving below results <output> <bookinstances> <instcode>B1</instcode> <instcode>B2</instcode> <instcode>EZ</instcode> </bookinstances> <bookinstances> <instcode>B3</instcode> <instcode>B4</instcode> <instcode>EZ</instcode> </bookinstances> <bookinstances> <instcode>B5</instcode> <instcode>EZ</instcode> </bookinstances> </output> |
   
Cocanada
Legend Username: Cocanada
Post Number: 48152 Registered: 01-2008 Posted From: 173.186.242.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 12:13 pm: |
     |
Just4fun:
xsl:if test="normalize-space(../../seq/text()="'1'") |
   
Emc2
Legend Username: Emc2
Post Number: 36654 Registered: 03-2008 Posted From: 128.229.4.22
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 12:10 pm: |
     |
Just4fun:
ohh that aa nee problem create one more variable and add for first time in the loop and turn off the flag check for that flag every time when you are adding the EZ it gaurantee to add once only |
   
Just4fun
Legend Username: Just4fun
Post Number: 30892 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 12:01 pm: |
     |
Emc2:xsl if use chesi seq 1 ayithe out pur EZ set cheyi
ide chestunna..kaani <instcode>EZ</instcode> anedi prati <bookinstances> ki add avutondi output ila vastondi <output> <bookinstances> <instcode>B1</instcode> <instcode>B2</instcode> <instcode>EZ</instcode> </bookinstances> <bookinstances> <instcode>B3</instcode> <instcode>B4</instcode> <instcode>EZ</instcode> </bookinstances> <bookinstances> <instcode>B5</instcode> <instcode>EZ</instcode> </bookinstances> </output> If check appudu edanna current node squ = 1 aite matrame add cheyu ani pettchocha? Current node imp |
   
Cocanada
Legend Username: Cocanada
Post Number: 48151 Registered: 01-2008 Posted From: 173.186.242.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 11:58 am: |
     |
db formatting deleted my test condition. admin vuncl..nee lo ee talent kudaa undaa? |
   
Cocanada
Legend Username: Cocanada
Post Number: 48150 Registered: 01-2008 Posted From: 173.186.242.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 11:58 am: |
     |
are you using apply template? or for-each? whatever you use, when you are composing <instcode> elements, add <xsl:if> <xsl:element><xsl:value-of></xsl:element> </xsl:if> |
   
Cocanada
Legend Username: Cocanada
Post Number: 48149 Registered: 01-2008 Posted From: 173.186.242.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 11:50 am: |
     |
emundi akkada thokka. nee xsl copy paste cheyyi. mistake ekkada undo cheptaa |
   
Emc2
Legend Username: Emc2
Post Number: 36653 Registered: 03-2008 Posted From: 128.229.4.22
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 11:49 am: |
     |
xsl if use chesi seq 1 ayithe out pur EZ set cheyi xpath use chesi seq ki var create cheyyi, or write a finction to check for seq and hold the variable for seq 1 tru false easy rajaa |
   
Cocanada
Legend Username: Cocanada
Post Number: 48148 Registered: 01-2008 Posted From: 173.186.242.11
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 11:48 am: |
     |
gimme 5 mins |
   
Just4fun
Legend Username: Just4fun
Post Number: 30891 Registered: 10-2007 Posted From: 75.181.155.41
Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, November 07, 2014 - 11:44 am: |
     |
Input XML: <input> <depositcode>EZ</depositcode> <books> <seq>1</seq> <book> <bookcode>B1</bookcode> <bookcode>B2</bookcode> </book> </books> <books> <seq>2</seq> <book> <bookcode>B3</bookcode> <bookcode>B4</bookcode> </book> </books> <books> <seq>3</seq> <book> <bookcode>B5</bookcode> </book> </books> </input> OutputXML: <output> <bookinstances> <instcode>B1</instcode> <instcode>B2</instcode> <instcode>EZ</instcode> </bookinstances> <bookinstances> <instcode>B3</instcode> <instcode>B4</instcode> </bookinstances> <bookinstances> <instcode>B5</instcode> </bookinstances> </output> XSLT use chesi input xml ni output xml ga convert cheyali..catch is EZ code target (output) side input side seq 1 unte matrame add avvali. ninnat nunchi try chestunna kadam ledu. |