Developer forum

Forum » Templates » Data from XML datalist

Data from XML datalist


Reply
Hi

I have this structure:

< View >
    < Rows >
        < Row >
            < Value Column="AccessUserUserName" >
                Advokatvirksomheder
           < /Value >
            < Value Column="AccessUserID" >
                1137
        < /Value >
    < /Row >

    < Row >
        < Value Column="AccessUserUserName" >
            Aktiehandel
        < /Value >
        < Value Column="AccessUserID" >
            1496
        < /Value >
    < /Row >
    

etc....

I want to do something like this:
< xsl:value-of select = "View/Rows/Row/Value [@AccessUserID] "/>
to extract the data. Im not sure about the syntax, and have spent the most af a day googling it.

What i find hard is targeting the
< Value Column="AccessUserID" >

I want to achieve a line like this:
< a href= "[THE ID]" > [ THE USERNAME] < /a >

Can anyone help me og point me in the right direction?

Regards
/Rune

EDIT: Hmm, no luck posting code, hence the spaces...


Replies

 
Morten Lund
Reply

Hi Rune

Did you find a solution for this? I know its an old post - but I hope you can remember :)

(I have spend the last 2 days googleing for the same question! I'm going nuts :) )

 
Rune Skovbo
Reply

Hi Morten

 

I ended up using some JS so it lookes like this:

<ul>
	<!--@LoopStart(Columns)-->
	<!--@LoopEnd(Columns)-->
	<!--@LoopStart(Rows)-->
		<!--@LoopStart(Row)-->
			<!--@If(Column.Count==0)-->
				<script type="text/javascript">
					MyAccessUserUserName = '<!--@Row.Value-->';
				</script>
			<!--@EndIf-->
			<!--@If(Column.Count==1)-->
				<script type="text/javascript">
					MyAccessUserID = '<!--@Row.Value-->';
				</script>
			<!--@EndIf-->
		<!--@LoopEnd(Row)-->
		<script type="text/javascript">
			if(MyAccessUserUserName != '' && MyAccessUserUserName != 'Alle' && MyAccessUserUserName != 'Extranet' && MyAccessUserUserName != 'Brugere' && MyAccessUserUserName != '0286' && MyAccessUserUserName != '0502' && MyAccessUserUserName != '0575' && MyAccessUserUserName != 'Tue' && MyAccessUserUserName != 'NEEDS ATTENTION' && MyAccessUserUserName != 'Udmeldte' && MyAccessUserUserName != 'All extranet users' && MyAccessUserUserName != 'All users'&& MyAccessUserUserName != 'Børsen Executive Club' && MyAccessUserUserName != 'International Community' && MyAccessUserUserName != 'MG50' && MyAccessUserUserName != 'NewsletterV3 categories' && MyAccessUserUserName != 'NewsletterV3 Recipients' && MyAccessUserUserName != 'Udviklingstjenesten')
			{
				document.write('<li><a href="?ID=3976&EAAGroupID='+MyAccessUserID+'&search=?">'+MyAccessUserUserName+'</a></li>');
			}
		</script>
	<!--@LoopEnd(Rows)-->
</ul>

The result of this (and other lists) can be seen here.

Hope that helps, otherwise write again :-)

 

/Rune

 

PS. Im sure this can be written more effective.

 

 
Morten Lund
Reply

Great - Thank you very much Rune :)

 

You must be logged in to post in the forum