BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


JavaScript
XML Data Traversal
TrimWhiteSpace
Two Tier Data Islands with Expanding/Collapsing Child elements.
Escape special characters using JavaScript and regular expressions
Sticky Table Headers
Dynamically Filling HTML Select Box from XML Data Island using Javascript.
XML Basics Handbook


 
 

 LAMP >>


By Dan Gurevich
First Posted 01/30/2003
Times viewed 250

Nested Tables And Data Island


Summary Nested Tables And Data Island

For example, we have XML in which represented users and their email addresses:

 <users>
  <user id=1 name=User1>
    <mailbox>aaa@aaa.com</mailbox>
    <mailbox>bbb@bbb.com</mailbox>
  </user>
  <user id=2 name=User2>
    <mailbox>ccc@ccc.com</mailbox>
    <mailbox>ddd@ddd.com</mailbox>
  </user>
</users>

Than we need to show table of users in which the first cell display user name and the second - user emails.
So binding for it looks like this:

<table datasrc=#xmldata border=1>
  <tr datafld=user>
    <td><span datafld=name></span></td>
    <td>

      <table datasrc=#xmldata datafld=mailbox border=1>
        <tr>
          <td><span datafld=$Text></span></td>
        </tr>
      </table>

    </td>
  </tr>
</table>

Note, that you need to declare datasrc for each nested table.

So, that's all. Hope it will be useful.

Dan Gurevich

Additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

 LAMP >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML