English 中文(简体)
更改XML 价值为html
原标题:Change XML value with html

This question has been asked more then once, but somehow I don t get things to work. I am struggling with this problem for some hours now already.

I got a xml file:

<?xml version="1.0" encoding="iso-8859-1"?>
<news>
   <field id="nettooppervlakte1">

           <name>Opp. netto</name>
           <content>970</content>
           <background>1</background>

   </field>
   <field id="nettooppervlakte2">

           <name>Ras 1</name>
           <content>Euro sunny</content>
           <background>1</background>

   </field>
   <field id="nettooppervlakte3">

           <name>Plantdichtheid 1 (st/m²)</name>
           <content>45</content>
           <background>1</background>

   </field>
</news>

xml文档是较大的,但无需填上整个档案(更多的领域)。

然后,我用在html(文字)中来获取信息:

$(document).ready(function(){
        var id = 0;
    $.ajax({
    type: "GET",
    url:"http://www.officespecialisten.it/wesleyfloor/table.xml",
    dataType: "xml",
    success: function(xml) {

    $(xml).find( field ).each(function(){
    var name = $(this).find( name ).text();
    var content = $(this).find( content ).text();
    var days = $(this).find( days ).text();
    var day = $(this).find( day ).text();
    var week = $(this).find( week ).text();
    var year = $(this).find( year ).text();

   $( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> +id++).html(name+ </a> ).appendTo( # +id+ name );
    $( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(content+ </a> ).appendTo( # +id+ content );
     $( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(days+ </a> ).appendTo( # +id+ days );
      $( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(day+ </a> ).appendTo( # +id+ day );
       $( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(week+ </a> ).appendTo( # +id+ week );
        $( <div class="items" id="link_ +"nettooppervlakte"+id+ "></div> ).html(year+ </a> ).appendTo( # +id+ year );

            });

            }
   });
});

并将其列入表(html):

<tr>
    <td colspan="2"  bgcolor="#ade500"><div id="1name"></div></td>
    <td colspan="2" bgcolor="#ade500"><div id="1content"></td>
</tr>
<tr>
     <td colspan="2" bgcolor="#ade500"><div id="2name"></div></td>
     <td width="2" bgcolor="#ffffcc"><div id="2content"> </td>


 </tr>
 <tr>
     <td colspan="2" bgcolor="#ade500"><div id="3name"></div></td>
     <td colspan="2" bgcolor="#ffffcc" ><div id="3content"></div></td>
 </tr>

And now the problem, I want that the user can change (with a input box or something) the value of (for example) "3content":

<td colspan="2" bgcolor="#ffffcc" ><div id="3content"></div></td>

1. 本轴线:

<content>45</content>

这样做是否容易? 由于我看到/推测了一些长页的法典(d试着它们全部),以改变1XML的价值,我认为,问题很多。

我正处在超文本/XML的开始阶段。 我使用的是roid、行动说明3、c++(主要是与CML图书馆)。 我还建立了我的第一个真正网站。

如果你们需要了解更多的事情或对一些事情的解释,那么就应该问。

感谢你的耐心,

散 动

最佳回答

你们需要监测点击事件,并提出一个附有投入的形式。 现有许多原始资料(Search “jquery inline edited”)而不是采用代号。 http://www.appelsiini.net/projects/jeditable”rel=“nofollow”

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签