Embed
Email

giai_de_thi_hk2_xmlud

Document Sample

Categories
Tags
Stats
views:
4
posted:
11/20/2011
language:
Vietnamese
pages:
13
1









LÝ THUYẾT

Phan_so.xml







CN XML & ƯD

2





]>







Day_so_nguyen.xml









]>

















Ham_so.xml











]>













Danh_sach_lop.xml











]>











De_thi_trac_nghiem.xml















]>



















y" />











LẬP TRÌNH



1. Viết ch/tr đọc và xuất dãy các số nguyên từ tập tin XML.

using System;

using System.Collections.Generic;

using System.Text;

using System.Xml;



namespace DeThi_HK2.Chuong_trinh

{

class Doc_xuat_day_so_nguyen

{

public static void Main()

{

string Duong_dan = "..\\..\\Du_lieu\\Day_so_nguyen.xml";

XmlDocument Tai_lieu = new XmlDocument();

Tai_lieu.Load(Duong_dan);

XmlElement Goc = Tai_lieu.DocumentElement;



for (int i=0; i















y" />











4. Viết ch/tr XSLT kết xuất đề thi trắc nghiệm trên Web















Câu hỏi trắc nghiệm















































CN XML & ƯD

7









LÝ THUYẾT

Kiểu : M



2



:

:



:









M













a CDATA #REQUIRED



b CDATA #REQUIRED



c CDATA #REQUIRED



>





]>



: iểu i

:



:



CN XML & ƯD

8



1 2



ML

















Ngay_sinh CDATA #REQUIRED



Xep_loai (“ ỏ ” “K ” ” Y ”) #IMPLIED

>





Gia_tri CDATA #REQUIRED



>

]>





am số

Tham_so : M



3





: a #REQUIRED

:



:





ML











Bien_so CDATA #REQUIRED



>







CN XML & ƯD

9





=0 -->

]>



: a #IMPLIED

:



:





ML (x) =2x2 -4x +6















Bien_so CDATA “ ”



>





So_mu (0,1,2) #REQUIRED



>

]>



: a #FIXED

:



:

Gia_tri



:

ML











Bien_so CDAT #FIXED “ ”



CN XML & ƯD

10



>











=0 -->

]>









Gia di Xm N de





m a G i

nodeType

nodeName

nodeValue S





selectSingleNode N e) e

Xpath

selectNodes N eL )

e Xpath

childNodes N eL )



parentNode N e)

)

ownerDocument (Docume )



appendChild N e)



removeChild

reaplaceChild



cloneNode S

“ ”

)

“ ”

)



Đối ượ Xm ume





m a G i

createElement e e )

creatAttribute e)



getElementsByTagName S

N eL ) e

Load ừ ồ S

)

LoadXML ừ

ML

Save K ồ S

)







CN XML & ƯD

11

Đối ượ Xm E eme





m a G i

getAttribute



getAttributeNode )



setAttribute



removeAttribute



removeAttributeNode )



getElementsByTagName T

N eL ) e



Đọ i i u XML

Vấ đề :

ML e



ướ iải quyế :





K e



K e Kq

K = ừ

ẫ ML)

K



Ghi chú :



- LT_XML )

- )

Vấ đề :

ghi e



ướ iải quyế :

ghi

e ẫ

K



Khai báo Kq

Kq = K

)

K



Ghi chú :



- LT_XML )

- )



Vấ đề :

ML

-

-

- ò

-





CN XML & ƯD

12



N



N === >

N == > ở ừ e e





ướ iải quyế với X ẻ ố



) L



K L



Khai báo Kq

Tai_lieu = e ừ

Goc = e e e

K

K



ướ iải quyế với X ẻ con ở ) L

e e Nut

K L



Khai báo Kq

K Nut

K





Vấ đề :

ML

- tin Phan_so.xml

-

- ò

- Ghi



N

Cách ghi

N === > và

N == > e e

khi ghi



ướ iải quyế với X ẻ ố



L



K



Khai báo Kq

Tai_lieu = e

Goc = Element ừ Tai_lieu

Gán

e

K =K e

K



ướ iải quyế với X ẻ con



g hàm L

e Tai_lieu

K e e







CN XML & ƯD

13

Khai báo XmlElement Kq

Kq = e e ừ ;e

K

K









-

-K -L





H chung :

S



H S N

S ee ew









CN XML & ƯD



Other docs by Stariya Js @ B...
Lab2_Fishing_lab_pack
Views: 0  |  Downloads: 0
JMK sample legal brief
Views: 1  |  Downloads: 0
DriveQ
Views: 0  |  Downloads: 0
cybersecurity_reform_-_senate_bill_eyes
Views: 0  |  Downloads: 0
Opening and Marketing
Views: 0  |  Downloads: 0
Making_it_Work_notes
Views: 0  |  Downloads: 0
First Announcement 7th ISFS_
Views: 0  |  Downloads: 0
as90173
Views: 0  |  Downloads: 0
VNAfashionshow2010
Views: 0  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!