Ò»¸ö¿ÉÒÔ´ÓexcelÖжÁÈ¡Êý¾Ý²¢Éú³ÉxmlµÄvba³ÌÐò
NND EXCEL2007£¬ÈÃÀÏ×ÓÕÒÁ˰ëÌì²Å°ÑbuttonÌí¼ÓÉÏÈ¥¡£
Sub °´Å¥1_Click()
Dim sFileName As String
Dim ws As Worksheet '´æ´¢Îļþ·¾¶ÃûºÍÎļþÃûµÄ¹¤×÷±í
Set ws = Worksheets("english") 'ÉèÖù¤×÷±í
sFileName = "d:\text.xml"
Set fso = CreateObject("Scripting.FileSystemObject")
Set orgFile = fso.OpenTextFile(sFileName, 2, True, -1)
'dim head and tail
Dim headline1, headline2, tailline, span_bef_english, span_aft_english, span_bef_foreign, span_aft_foreign
headline1 = "<?xml version=""1.0\"" encoding=""utf-8\""?>"
headline2 = "<systems>"
tailline = "</systems>"
'dim span before english
span_bef_english = "<setting id=""id_xx"">" & Chr$(13) & "<content_en>"
'dim span after english
span_aft_english = "</content_en>"
'dim span before foreign language
span_bef_foreign = "<content_fgn>"
'dim span after forergn language
span_aft_foreign = "</content_fgn>" & Chr$(13) & "</setting>"
'write_x
Ïà¹ØÎĵµ£º
×î½ü¿´µ½ÁËÒ»¸öÏîÄ¿½âÎöxmlµÄ·½Ê½£¬¾õµÃÒ²²»´í£¬²âÊÔϸú´ó¼Ò·ÖÏíÏ£¡ÑÛϽâÎöxmlµÄ·½Ê½ºÜ¶à£¬ÕâÀï²»ÌáÁË£¡Ö»Ì¸Ì¸digesterµÄʹÓã¬Ç³Ì¸°É£¡Ï£ÍûÒÔºóÄãÃÇÓöµ½ÁËÄÜÓеã°ïÖú°É£¡
Ê×ÏÈÔÚʹÓÃDigester½âÎöxmlʱҪµ¼Èë2¸öjar°ü£¬ÓеÄÈË˵ÊÇ4¸ö£ ......
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.xpath.XPath;
public class XMLReader {
priv ......
ÊÇ·ñÑá¾ëÁËÓÃxmlÎļþÀ´×öMagentoµÄÒ³Ãæ²¼¾Ö£¬ÊǵϰÀ´ÊÔÊÔÏÂÃæÕâÖÖ·½Ê½£¬°Ñ²¼¾Ö´úÂëдµ½controller ÀïÃæ
public function mycoolAction()
{
/* ... Some code ...*/
$update = $this->getLayout()->getUpdate();
/* ... Some code ...*/
$this->addActionLayoutHandles();
/* ... Some code ...*/
......
1 ÀàËÆxmlns=""µÄÎļþ
ʾÀýXMLÎļþ:
<?xml version="1.0" encoding="UTF-8"?>
<WebSrvMessage xmlns="http://www.lenoval.com/">
<version>1.0</version>
<DataContent>
<DateTag>2010-5-17</DateTag>
</DataCont ......
Loading XML data using ActionScript 3.0
By Blue_Chi | Flash CS3 | ActionScript 3.0 | Beginner
Using XML is one of the best ways for structuring external content in a logical format that is easy to understand, process, and update. This tutorial will teach you the basics on how to load and process X ......