开发者

SimpleXML adding childs and attributes for excel

I'n really new to this and my question should be simple. Lets say i have this xml:

    <?xml version="1.0"?>
    ....
        xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
    ....
    <Worksheet ss:Name="sheet1">
    ....
    <Worksheet ss:Name="sheet2">
    ....

How do i add in worksheet 1 a cell in row 5 looking like this:

    <Cell ss:Index="5" ss:StyleID="s22"><Data ss:Type="Str开发者_开发问答ing">Some text</Data></Cell>

using SimpleXML? Anyone with sample of code, please.


First of all, you have to retrieve the node you need using a Location Path and then, after you construct the new element, you can use the method addchild.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜