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

Creating "mailto" in a XML file (from another XML file

Subject: Creating "mailto" in a XML file (from another XML file using XSL)
From: vipul.vij@xxxxxxxxxxxx
Date: Wed, 4 Jun 2003 16:30:09 +0100
xslt mailto link



Hello to you all,

I am using the following XSL processor:

Vendor: Microsoft
Vendor URL: http://www.microsoft.com


I am trying to generate "mail to" links from a  XML file (that has been
created from a bug DB dump in MySQL) in my output XML file. I have got all
other bug fields working OK.
Problem: I have two tables:

i.)   First table contains bug details including a person_id (id number of
who the bug was assigned to) - but no further detail such as e-mail
address, first name etc.

ii.)  Second table has all the developers' details including the person_id
and their associated details.

So although I can go through table1 and pull out bug details according to a
certain criteria, how can I link this information to the second table and
pull out the developer's
details such as e-mail address?

Part of my source XML file to give you the idea:


<?xml version="1.0"?>
<mysqldump>
<table name="phpbt_bug">
       <row>
          <field name="bug_id">1</field>
          <field name="title">Contacts Disappearing from Distribution Lists
</field>
          <field name="description">If a contact us updated from the
&amp;quot;Edit Contact&amp;quot; screen then they are somehow removed from
any distribution lists they were on.</field>
          <field name="url"/>
          <field name="severity_id">5</field>
          <field name="priority">1</field>
          <field name="status_id">7</field>
          <field name="resolution_id">1</field>
          <field name="database_id">0</field>
          <field name="site_id">0</field>
          <field name="assigned_to">5</field>
          <field name="created_by">1</field>
          <field name="created_date">1049903813</field>
          <field name="last_modified_by">1</field>
          <field name="last_modified_date">1052321523</field>
          <field name="project_id">1</field>
          <field name="version_id">6</field>
          <field name="component_id">5</field>
          <field name="os_id">1</field>
          <field name="browser_string">Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1)</field>
          <field name="close_date">1052321523</field>
          <field name="closed_in_version_id">12</field>
          <field name="to_be_closed_in_version_id">12</field>
       </row>
       <row>
          <field name="bug_id">2</field>
          <field name="title">Allocation of Department SMS</field>
          <field name="description">Allocation of department SMS doesn't
work properly.</field>
          <field name="url"/>
          <field name="severity_id">7</field>
          <field name="priority">3</field>
          <field name="status_id">7</field>
          <field name="resolution_id">2</field>
          <field name="database_id">0</field>
          <field name="site_id">0</field>
[REST OF THE BUGS]
|
|
|....................................................................

<table name="phpbt_auth_user">
       <row>
          <field name="user_id">1</field>
          <field name="login">umbersp</field>
          <field name="first_name">System</field>
          <field name="last_name">Admin</field>
          <field name="email">someone@xxxxxxxxxxxxx</field>
          <field name="password">**********************</field>
          <field name="active">1</field>
          <field name="bug_list_fields">
a:8:{i:0;s:6:&quot;bug_id&quot;;i:1;s:5:&quot;title&quot;;i:2;s:13:&quot;severity_name&quot;;i:3;s:8:&quot;priority&quot;;i:4;s:11:&quot;status_name&quot;;i:5;s:15:&quot;resolution_name&quot;;i:6;s:8:&quot;reporter&quot;;i:7;s:5:&quot;owner&quot;;}
</field>
          <field name="created_by">0</field>
          <field name="created_date">0</field>
          <field name="last_modified_by">0</field>
          <field name="last_modified_date">0</field>
       </row>
       <row>
          <field name="user_id">2</field>
          <field name="login">owens</field>
          <field name="first_name">Sam</field>
          <field name="last_name">Owen</field>
          <field name="email">someone@xxxxxxxxxxxxx</field>
          <field name="password">***********************************8</
field>
          <field name="active">1</field>
          <field name="bug_list_fields">
a:8:{i:0;s:6:&quot;bug_id&quot;;i:1;s:5:&quot;title&quot;;i:2;s:13:&quot;severity_name&quot;;i:3;s:8:&quot;priority&quot;;i:4;s:11:&quot;status_name&quot;;i:5;s:15:&quot;resolution_name&quot;;i:6;s:8:&quot;reporter&quot;;i:7;s:5:&quot;owner&quot;;}
</field>
          <field name="created_by">1</field>
          <field name="created_date">1049904081</field>
          <field name="last_modified_by">1</field>
          <field name="last_modified_date">1049904081</field>
       </row>
       <row>
          <field name="user_id">3</field>
          <field name="login">widdowsonj</field>
          <field name="first_name">Jade</field>
          <field name="last_name">Widdowson</field>
          <field name="email">someone@xxxxxxxxxxxxx</field>
          <field name="password">***************************88</field>
          <field name="active">1</field>
          <field name="bug_list_fields"/>
          <field name="created_by">1</field>
          <field name="created_date">1049904135</field>
          <field name="last_modified_by">1</field>
          <field name="last_modified_date">1049904135</field>
       </row>
       <row>
          <field name="user_id">4</field>
          <field name="login">mortond</field>
          <field name="first_name">Duncan</field>
          <field name="last_name">Morton</field>
          <field name="email">someone@xxxxxxxxxxxxx</field>
          <field name="password">************************************8</
field>
          <field name="active">1</field>
          <field name="bug_list_fields"/>
          <field name="created_by">1</field>
          <field name="created_date">1049904181</field>
          <field name="last_modified_by">1</field>
          <field name="last_modified_date">1049904181</field>
       </row>
       <row>
          <field name="user_id">5</field>
          <field name="login">shahzadm</field>
          <field name="first_name">Mohammad</field>
          <field name="last_name">Shahzad</field>
          <field name="email">someone@xxxxxxxxxxxxx</field>
          <field name="password">**********************************</field>
          <field name="active">1</field>
          <field name="bug_list_fields"/>
          <field name="created_by">1</field>
          <field name="created_date">1049904225</field>
          <field name="last_modified_by">1</field>
          <field name="last_modified_date">1049904225</field>
       </row>
       <row>
          <field name="user_id">6</field>
          <field name="login">seageri</field>
          <field name="first_name">Ian</field>
          <field name="last_name">Seager</field>
          <field name="email">someone@xxxxxxxxxxxxx</field>
          <field name="password">******************************</field>
          <field name="active">1</field>
          <field name="bug_list_fields"/>
          <field name="created_by">1</field>
          <field name="created_date">1049906393</field>
          <field name="last_modified_by">1</field>
          <field name="last_modified_date">1049906393</field>
       </row>
       <row>
          <field name="user_id">8</field>
          <field name="login">russellj</field>
          <field name="first_name">Julie</field>
          <field name="last_name">Russell</field>
          <field name="email">someone@xxxxxxxxxxxxx</field>
          <field name="password">****************************</field>
          <field name="active">1</field>
          <field name="bug_list_fields"/>
          <field name="created_by">1</field>
          <field name="created_date">1050318210</field>
          <field name="last_modified_by">1</field>
          <field name="last_modified_date">1050318210</field>
       </row>
     </table>
</database>
</mysqldump>

=================================================================================================================================
And my XSL file:


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes"/>
  <xsl:template match="/">
       <document>
        <properties>
          <author email="vipul.vij@xxxxxxxxxx">Vipul Vij</author>
        </properties>
        <body>
          <section name="Bugs fixed">
            <xsl:variable name="fixed" select="
mysqldump/database/table/row[field[@name = 'status_id'] = 7 and field[@name
= 'resolution_id'] = 1]"/>
            <p>Summary of bugs that have now been fixed:</p>
            <xsl:if test="$fixed">
              <ol>
                <xsl:for-each select="$fixed">
                  <xsl:sort select="field[@name = 'bug_id']"/>
                  <li>
                    <xsl:value-of select="field[@name = 'title']"/>
                  </li>
                </xsl:for-each>
              </ol>
            </xsl:if>
            <table>
              <tr>
                <td>Bug ID</td>
                <td>Name</td>
                <td>Description</td>
                <td>Fixed by</td>
              </tr>
              <xsl:for-each select="$fixed">
                <xsl:sort select="field[@name = 'bug_id']"/>
                <tr>
                  <td>
                    <a href="http://intranet/phpbt-0.9.1
/bug.php?op=show&amp;bugid={field[@name = 'bug_id']}">
                      <xsl:value-of select="field[@name = 'bug_id']"/>
                    </a>
                  </td>
                  <td>
                    <xsl:value-of select="field[@name = 'title']"/>
                  </td>
                  <td>
                    <xsl:value-of select="field[@name = 'description']"/>
                  </td>
                  <td>
                  <xsl:variable name="email" select="
mysqldump/database/table/row[field[@name = 'assigned_to'] = field[@name =
'user_id'] ]"/>
 <xsl:for-each select="$email">
<xsl:value-of select="$email"/>
                    <a href="mailto:vipul.vij@xxxxxxxxxx";>Vipul Vij</a>
                    </xsl:for-each>
                  </td>
                </tr>
              </xsl:for-each>
            </table>
          </section>
        </body>
      </document>
  </xsl:template>
 </xsl:stylesheet>

===============================================================================================================

Any help will be kindly appreciated.

Regards,

Vipul


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.