Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT <> XML can't get it work right.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,

I've to make a login-page with different buttons. Several things I've tried (see comments in xlt code) but it wil not work. I must say that I am very new in this area but can't find what I am looking for.

Wen a tag in <conOptions> looks like <optTodayPage/> (is empty) than I want to fill the options with in this case: &quot;UserItf..AspToday=1&quot; (not relevant for this xml).

CAN ANYBODY HELP ME OUT PLEASE?

This is the (generated by my program made in VB) XML I want to process:

[ XML ]

<?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?>
<?xml-stylesheet type='text/xsl' href='LoginGeneratorExample.xsl'?>

<iDiMSLoginGenerator>

<loginPageName>loginPageName iDiMS login</loginPageName>
<CompName>compName Pukkers BV</CompName>

<loginConnection>

<conName DbsName=&quot;rse4813&quot; SrvName=&quot;Shark&quot; srvPort=&quot;8001&quot;>conName rcG</conName>
<conAppRelease relMajor=&quot;522&quot; relClient=&quot;rcG&quot; relServer=&quot;rcH&quot;></conAppRelease>

<!-- Possible more options if not presented than
the option wasn't select -->
<conOptions>
<optTodayPage/>
<optSelSequence/>
</conOptions>

</loginConnection>

<loginConnection>

<conName DbsName=&quot;rse4813123&quot; SrvName=&quot;Shark&quot; srvPort=&quot;8004&quot;>conName sp F</conName>
<conAppRelease relMajor=&quot;522&quot; relClient=&quot;spf&quot; relServer=&quot;spf&quot;></conAppRelease>
<conOptions>
<optTodayPage/>
<optSelSequence/>
</conOptions>

</loginConnection>

</iDiMSLoginGenerator>

And here the xlt:

[ XLT ]

<xsl:stylesheet xmlns:xsl = &quot; version = &quot;1.0&quot; >
<xsl:template match = &quot;/&quot; >

<!-- ''''' BEGIN LOGIN BUTTONS '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -->

<xsl:for-each select=&quot;iDiMSLoginGenerator/loginConnection&quot;>

<IMG onclick=&quot;subDiMS Name, Version, Options&quot;
height=&quot;79&quot;
width=&quot;72&quot;
src=&quot;bm-loginpage/Development.gif&quot;
border=&quot;0&quot;>
</IMG>

<IMG height=&quot;1&quot; src=&quot;bm-loginpage/shim.gif&quot; width=&quot;5&quot; border=&quot;0&quot;></IMG>

<xsl:value-of select=&quot;conName&quot;/>
<xsl:text> </xsl:text>
<xsl:value-of select=&quot;conAppRelease&quot;/>
<xsl:text> </xsl:text>
<xsl:value-of select=&quot;conOptions&quot;/>

<BR></BR>

</xsl:for-each>

<!--
<xsl:for-each select=&quot;conName&quot;>
<xsl:value-of select=&quot;text()&quot;/>
<xsl:text> </xsl:text>
<xsl:apply-templates select=&quot;@DbsName&quot;/>
<xsl:text> </xsl:text>
<xsl:apply-templates select=&quot;@SrvName&quot;/>
</xsl:for-each>
-->
<!-- <xsl:value-of select=&quot;conName&quot;/> -->
<!-- <xsl:text > </xsl:text> = Spatie of ander teken -->

<!-- ''''' END LOGIN BUTTONS '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -->

</xsl:template>
</xsl:stylesheet>
 
>1.
>do you use client side processing or server side processing?
Client side processing.

>2.
>get rid of the ';' after xmlns:xsl >= &quot;Euh... I've never had this in my xlt. Maybe a typo :)

>3.
>after that, using simple client side processing, it worked for me, i >only gat the obvious javascript erros because in: onclick=&quot;subDiMS >Name, Version, Options&quot; you seem to have done something strange.
>What are Name, Version,... Are these functions you want to call?
It's a call to the function subDiMS wich I didn't post because it was not relevant. I also left out the rest of the xlt sheet: all the html of the loginpage.

Sure it works; 2 buttons will be loaded with it's name (from the node &quot;conName&quot;), but I want to show all data from the xml; especially the attributes. That's my problem.

[ XML Data ]

<loginConnection>

<conName DbsName=&quot;rse4813&quot; SrvName=&quot;Shark&quot; srvPort=&quot;8001&quot;>conName rcG</conName>
<conAppRelease relMajor=&quot;522&quot; relClient=&quot;rcG&quot; relServer=&quot;rcH&quot;></conAppRelease>

<!-- Possible more options if not presented than
the option wasn't select -->
<conOptions>
<optTodayPage/>
<optSelSequence/>
</conOptions>

</loginConnection>


[ PREFERRED END RESULT in the onclick of the image wich I can't get to ]

<IMG onclick=&quot;subDiMS
'iDiMS2', 8
'522.clientrcG.serverrcH&remotehost=Shark&database=PROD,ora/rse4813&remoteport=8001',
'useritf.defaultinstance=AspToday&useritf..askorderby=1'
height=&quot;79&quot;
width=&quot;72&quot;
src=&quot;bm-loginpage/Development.gif&quot;
border=&quot;0&quot;>
</IMG>

<IMG height=&quot;1&quot; src=&quot;bm-loginpage/shim.gif&quot; width=&quot;5&quot; border=&quot;0&quot;></IMG>

&quot;conName rcG&quot;


- Explaination of subDiMS(Name, Version, Options) (<IMG onclick=&quot;subDiMS(Name, Version, Options)&quot;:
In the onclick event of the loginbutton/img. it refers to vb code in the top of the page/xlt. This code sents the loginparameters of the button
to our application.

The data in onclick=&quot;subDiMS Name, Version, Options&quot; of the IMG should come out of the XML file.
I only can get the text of the nodes, not of it's attributes;
- like DbsName=&quot;rse4813&quot;:
<conName DbsName=&quot;rse4813&quot; SrvName=&quot;Shark&quot; srvPort=&quot;8001&quot;>conName rcG</conName>

Did I make myself clear enough? I would really apreciate your help.

Thank you in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top