English 中文(简体)
如何在窗户电话中分离XML 7
原标题:How to split XML in windows phone 7

• 如何分割XML? 我正在使用这一法典。

public static String insertNewMsg(String aMsg, String newMsgXML)
{
    String retXML = null;
    //int size = aMsg.s
    String[] strParts = aMsg.Split("</messages>");
    if (strParts.Length >= 0)
    {
        retXML = strParts[0] + newMsgXML + "</messages>";
    }
    return retXML;
}

我想在末端(即“?messages”)到达时就座。

问题回答

Don t试图通过扼杀行动处理XML。 使用XML图书馆——Windows Telephone 7支持LINQ to XML,这将使你的生活更容易lot

你说的是,你试图做些什么,但是,这很可能非常简单地利用LLLQ到XML。

EDIT:你现在发表的评论表明,你正在利用扼杀性分类来建造原来的XML。 http://www.un.org。 它把用户价值列入QQL,而不是使用参数分类的电梯,从而相当于建造一个电梯。 LINQ至XML是一个热爱的图书馆,在Windows 7的大力支持下,当你想要履行any时,即可使用。 XML业务——制造、 par或操纵。

In WP7, complex XML files can be easily handled by the LINQ than the string operations, It may XML to LINQ or LINQ to XML.

You can get detail information about the LINQ and samples here





相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

热门标签