上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
hkhome
註冊時間: 2004-03-01 文章: 43
第 1 樓
|
發表於: 星期四 六月 10, 2004 3:53 pm 文章主題: xmltocursor |
|
|
各位大俠,我有個Xml打算用Foxpro 寫支程式把Xml接入table,試過用foxpro Xmltocursor(512),但很多資料都會流失(讀不進cursor或亂了)。
可否指教一下
檔案太長,所以不直接放這,希望得到一點啟蒙。
謝謝
http://www.hkhorsedb.com/FBOD.xml |
|
回頂端 |
|
 |
elleryq

註冊時間: 2007-06-21 文章: 768
第 2 樓
|
發表於: 星期五 六月 11, 2004 8:54 am 文章主題: |
|
|
我建議弄出該 xml 的 dtd, 這樣 vfp 才會知道該建立哪些欄位.
另外你也可以試著用 cursortoxml() 轉出的結果與這個 xml 檔作比較看看. |
|
回頂端 |
|
 |
hkhome
註冊時間: 2004-03-01 文章: 43
第 3 樓
|
發表於: 星期六 六月 12, 2004 11:22 am 文章主題: |
|
|
thx elleryq
請問dtd是甚麼東西?? |
|
回頂端 |
|
 |
elleryq

註冊時間: 2007-06-21 文章: 768
第 4 樓
|
發表於: 星期一 六月 14, 2004 9:07 am 文章主題: |
|
|
DTD Tutorial: http://www.xmlfiles.com/dtd/
DTD = Document Type Definition
簡單說,就是 XML 裡面各欄位的資料型態定義.
主要用途是用來檢驗你收到的 xml 是否正確, 對資料庫應用程式來說,也可以依據 它來建立 data structure. |
|
回頂端 |
|
 |
hkhome
註冊時間: 2004-03-01 文章: 43
第 5 樓
|
發表於: 星期一 六月 14, 2004 4:32 pm 文章主題: |
|
|
啊,明白了,謝謝elleryq兄。
我看看怎樣弄出個dtd來看看。
謝謝 |
|
回頂端 |
|
 |
syntech
註冊時間: 2003-05-16 文章: 4249 來自: Taipei,Taiwan
第 6 樓
|
發表於: 星期一 六月 14, 2004 4:58 pm 文章主題: |
|
|
cursorToXml 的 參數cSchemaName = '1',
會作一個給你
------------------------------------
cSchemaName
Specifies the name and location of the schema information for the data in cFileName. cSchemaName Description
"" Specifies that no schema will be produced
"1" Specifies that an inline schema be produced
<cSchemaName> Specifies the name and path of the external file to contain the schema (scoped to the root element of the XML)
If cSchemaName contains a file name, and the cSchemaLocation parameter is not provided or is blank, the contents of cSchemaName are written to the xsi:schemaLocation or xsi:noNamespaceSchemaLocation attribute in the XML.
In the following code, Visual FoxPro generates a generic XML file, myxmlfile.xml, from labels.dbf in the "Labels" alias and the schema file, mySchema, in the same folder.
CursorToXML("LABELS", "myXMLFile.xml", 1, 512, 0, "mySchema.xsd")
If you specify "", instead of "mySchema," then no schema is produced; specifying "1," as in the following, produces an inline schema:
CursorToXML("LABELS", "myXMLFile.xml", 1, 512, 0, "1")
------------------------------------------ _________________ 如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問
請聯絡我們,也許我們幫得上忙 |
|
回頂端 |
|
 |
hkhome
註冊時間: 2004-03-01 文章: 43
第 7 樓
|
發表於: 星期二 六月 15, 2004 6:41 pm 文章主題: |
|
|
syntech兄,你的意思是,我先因應我想要的FIELD來CREATE一個TABLE,再用CURSORTOXML CREATE一個含XSD的XML? |
|
回頂端 |
|
 |
hkhome
註冊時間: 2004-03-01 文章: 43
第 8 樓
|
發表於: 星期二 六月 15, 2004 6:44 pm 文章主題: |
|
|
另外我也十分不明白,我試著用XML DOM,但我實在找不到怎可以GET
<MATCH NUM="1" DATE = "123456">
</MATCH>
試了很久也沒有辦法可以得到MATCH NUM.VALUE OR MATCH DATE,VALUE。
而其他的例如<SSA>abc</SSA>是可以Get到.... |
|
回頂端 |
|
 |
hkhome
註冊時間: 2004-03-01 文章: 43
第 9 樓
|
發表於: 星期二 六月 15, 2004 6:46 pm 文章主題: |
|
|
我試著用nodevalue,但因為那個match node有兩個value,請問應怎設定要讀那個value? |
|
回頂端 |
|
 |
hkhome
註冊時間: 2004-03-01 文章: 43
第 10 樓
|
發表於: 星期二 六月 15, 2004 6:46 pm 文章主題: |
|
|
對不起,一次問那麼多問題,我會繼續努力括尋。
thx a lot |
|
回頂端 |
|
 |
syntech
註冊時間: 2003-05-16 文章: 4249 來自: Taipei,Taiwan
第 11 樓
|
發表於: 星期三 六月 16, 2004 10:02 am 文章主題: |
|
|
如果你是用 cursortoxml 產生 xml 的話,
可以利用這個屬性產生 dtd,
如果不是,或是沒有
你必須仿造這個方式,產生你自己的dtd,
利用 ALTER TABLE - sql 或是其他命令建立 table structure,
再利用 xmltocursor 把xml轉回cursor _________________ 如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問
請聯絡我們,也許我們幫得上忙 |
|
回頂端 |
|
 |
hkhome
註冊時間: 2004-03-01 文章: 43
第 12 樓
|
發表於: 星期三 六月 16, 2004 3:14 pm 文章主題: |
|
|
明白,謝謝syntech
noodmatch = oXML.documentElement.selectSingleNode("MATCH")
? matchnum.getAttribute("NUM") && Display 1
? matchnum.getAttribute("DATE")&& Display 123456
<MATCH NUM="1" DATE = "123456">
</MATCH> |
|
回頂端 |
|
 |
hkhome
註冊時間: 2004-03-01 文章: 43
第 13 樓
|
發表於: 星期三 六月 23, 2004 10:09 pm 文章主題: |
|
|
玩了幾天xmldom,感覺上好像會把data全放在一個陣列上,之後再因應欄、列來抓data。
確實是蠻方便的。 |
|
回頂端 |
|
 |
|