Solved

XML Data Binding

Posted on 2001-07-18
8
839 Views
Last Modified: 2008-03-04
Friends,

I am using a multi level XML, & using IE5 or above browser, please tell me how to bind text boxes (input boxes) with them, for example

my XML is :-
<XML id=objXML>
  <first>
    <second>
      <third1>value1</third1>
      <third2>value1</third2>
      <third3>value1</third3>
    </second>
  </first>
</XML>

my HTML is :-
<input type=text datasrc=#objXML datafld= ?????? >

please help me, my email id is vijayneema@hotmail.com

Thanks
Vijay
0
Comment
Question by:vijayneema
8 Comments
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 6297462
<input type=text datasrc=#objXML datafld=third1 >

0
 
LVL 1

Author Comment

by:vijayneema
ID: 6297470
Yury Delendik

It will not work if the xml is like this, as i said earlier
my xml is multi level


<XML id=objXML>
<root>
 <first>
   <second>
     <third1>value1</third1>
     <third2>value1</third2>
     <third3>value1</third3>
   </second>
 </first>
</root>
</XML>

0
 
LVL 1

Expert Comment

by:hariweb
ID: 6297945
Hi,

I think Yury is right.  Just save everything as a HTML file like given below.


<html>
<body>
<form>
<XML id=objXML>
 <first>
   <second>
     <third1>value1</third1>
     <third2>value2</third2>
     <third3>value3</third3>
   </second>
 </first>
</XML>


<input type=text datasrc=#objXML datafld= third1 >
</form>
</body>
</html>



Alternatively..u can do this.....give this alone in say xyz.xml

<first>
   <second>
     <third1>value1</third1>
     <third2>value2</third2>
     <third3>value3</third3>
   </second>
 </first>


then create a html file with the following code....
<html>
<body>
<form>
<xml id="objXML" src="xyz.xml"></xml>
<input type=text datasrc=#objXML datafld= third1 >
</form>
</body>
</html>

try it..-:)
Hari


0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Author Comment

by:vijayneema
ID: 6298007
Dear Hari,

Problem is that my XML is multi level
<XML id="objXML">
<first>
    <second>
        <third>
             <fourth>
                 <fifth1>v1<fifth1>
                 <fifth2>v2<fifth2>
                 <fifth3>v3<fifth3>
             </fourth>
        </third>
    </second>
</first>
</XML>

<input type=text datasrc=#objXML datafld=fifth1 >

now my input box does not binds.

Please if you want in detail contact me as
vijayneema@hotmail.com

bye
Vijay
0
 
LVL 1

Expert Comment

by:sethu_m
ID: 6303069
Hello,

U can have a solution like this - If ur XML is of somewhat like this structure

<XML id="objXML">
<first>
   <second>
       <third>
            <fourth>
                <fifth1>sethu madhavan</fifth1>
            </fourth>
            <fourth>
                <fifth1>mahesh pudale</fifth1>
            </fourth>

       </third>
   </second>
</first>
</XML>

then put ur html like this

<table datasrc=#objXML datafld="third">
 <tr>
   <td>
     <table datasrc=#objXML datafld="fourth">
     <tr>
       <td>
          <input datafld="fifth1">    
       </td>
     </tr>
     </table>
   </td>
  </tr>
</table>

U will have to put all ur top elements in a table with datasrc same and datafld changing with each level of depth.

U can arrive at any depth with this kind of approach.

I hope this will work for u.

0
 
LVL 1

Author Comment

by:vijayneema
ID: 6307631
Thanks sethu_m

but it is working with Table only
not with Input box, if give me solution
for Input, Select Boxes

Vijay
0
 
LVL 1

Accepted Solution

by:
sethu_m earned 50 total points
ID: 6308581
Hello Vijay,

You can not populate the select boxes/list boxes, but ofcourse u can populate the input boxes.

But again for that u will have to create a hirearchy of some container like Tables or Div. - As I have mentioned earlier.

try div - if u don't want tables
0
 
LVL 1

Author Comment

by:vijayneema
ID: 6311206
Thanks sethu madhavan

It is working. thanks a lot once again
Please be in touch with me, if you have
any more ideas. my email id is
vijayneema@hotmail.com

Vijay
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question