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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write information in HTML format on a popup window called from XSLT

Status
Not open for further replies.

adhp55555

Programmer
Oct 24, 2003
9
US
A MS Access database has been converted into an XML database. The XML data is then displayed in a table via means of an XSLT and CSS. Because there is not enough room for an entire record to be displayed in a row, I assigned an "href" for each Data Dictionary field (XML name: FIELDDDN)in each row of table so that when users click one of each href, a new window with a smlaler size will be popped up to display additional information. The anchor href for each 'Data Dictionary Field" is as follows

<td><a><xsl:attribute name=&quot;href&quot;>Javascript:popUpWindow(&quot;<xsl:value-of select=&quot;FIELDXMLTAG&quot;/>&quot;,<xsl:value-of select=&quot;FIELDDDN&quot;/>)</xsl:attribute><xsl:value-of select=&quot;FIELDDDN&quot;/></a></td>

And the PopupWindow is as follows:
function PopUpWindow(xmlTag,ddnnum)
{

ExtraWin = window.open(&quot;&quot;, &quot;_blank&quot;, config='width=500,height=300,left=200,top=150');
ExtraWin.document.write(&quot;DDN Number : &quot; + ddnnum + &quot; &quot;);
ExtraWin.document.write(&quot;XML Tag : &quot; + xmlTag);


}

The Pop up Windows works fine, except that I cannot display two fields: &quot;ddnnum&quot; and &quot;xmlTag&quot; in two separate lines. I have tried to include &quot;\n&quot; in write statement but Javascript seemed to ignore &quot;\n&quot;\. Questions:
1) how do I write it in one line and another &quot;write&quot; statement in another line ?
2) Can I display information in the new popup window in HTML format using <TABLE>, <TR>, <TD>, <H1>, <H2>, etc.. ? How? It seems to me that in XSLT, we cannot use &quot;Write&quot; command format the display in HTML form. If we can, please show me how by using an example.
3) Can we use VBScript along with Javascript in XSLT ?
Thank you for your help.
adhp
 

q.1
ExtraWin.document.write(&quot;DDN Number : &quot; + ddnnum + &quot;<br>&quot;);
ExtraWin.document.write(&quot;XML Tag : &quot; + xmlTag);

q.2
see q.1

q.3
In what context would you want to use vbscript? remember that vbscript is only supported in ie browsers. Other than that - just write you vb functions/subs within <script type=&quot;text/vbscript&quot;> tags.

 
1) Thank you Simonchristieis. In the past I did try to use &quot;<br>&quot; but it didn't work. The screen went blank. However, with your response, I happened to remember that XML always requires paired tags (Opening and closing tags); therefore I added the end tag: &quot;</br>&quot; to the Write Statement as:
ExtraWin.document.write(&quot;DDN Number : &quot; + ddnnum + &quot;<br></br>&quot;);
and it worked. Thank you very much.

2) I will continue to apply the paired tags for question #2
3) I might or might not use VBScript. If I use it, I will follow your instruction. My application runs on Microsoft ie only; therefore it's safe to use it. However, I will try not to.

Thank you again for your help.

adhp55555
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top