![Phân tích tư tưởng của nhân dân qua đoạn thơ: Những người vợ nhớ chồng… Những cuộc đời đã hóa sông núi ta trong Đất nước của Nguyễn Khoa Điềm](https://timtailieu.net/upload/document/136415/phan-tich-tu-tuong-cua-nhan-dan-qua-doan-tho-039-039-nhung-nguoi-vo-nho-chong-nhung-cuoc-doi-da-hoa-song-nui-ta-039-039-trong-dat-nuoc-cua-nguyen-khoa-136415.jpg)
Creating Applications with Mozilla-Chapter 10. RDF, RDF Tools, and the Content Model -P2
Số trang: 16
Loại file: pdf
Dung lượng: 51.52 KB
Lượt xem: 1
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Tham khảo tài liệu creating applications with mozilla-chapter 10. rdf, rdf tools, and the content model -p2, công nghệ thông tin, quản trị web phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả
Nội dung trích xuất từ tài liệu:
Creating Applications with Mozilla-Chapter 10. RDF, RDF Tools, and the Content Model -P2 Chapter 10. RDF, RDF Tools, and the Content Model -P2This files root resource is an urn:root, which is the conventional namefor root nodes in Mozillas RDF files. When rendering RDF files, defining aroot node for processing the document can be useful -- especially whenbuilding templates. This root node can be entered as the first item in the file: 10.1.3.3. Root sequenceNext, a generic tag needs to be used to specify a sequence of fly data. Asin Example 10-2, is used as a list of fly types. This tag is ageneric name because of the way XUL templates process lists of RDF data.If a list of data has sublists, as in the following examples, then they must usethe same tag name to recurse correctly for the data they contain.Example 10-2 represents all the information given in the first paragraph ofthe text example: There is a jar set up with the name urn:root. Inside ofit there are two types of flies, listed as House and Horse.Example 10-2. RDF root sequence An RDF sequence resides with its list of resources inside .Here, shorthand RDF specifies a label with the fly:label attribute. TheID attribute within this sequence is actually a pointer to the main definitionof the resource described by an about attribute of the same value. Theabout attribute includes a # in its identifier, much like HTML anchors use to refer to . For example,ID=Horse points to about=#Horse elsewhere in the file, allowingyou to add to the description of any element with new properties andresources.10.1.3.4. Secondary sequences and literalsThe Horse and House resources need to be defined next. Example 10-3shows the creation of Horse from the second paragraph. The process forcreating House is almost identical.Example 10-3. The Horse sequence Here the shorthand RDF definition continues to use only the attributes.Again, a is defined and the items inside it are listed. Thelisted values have multiple attribute values, all of which are RDF literals. Inlonghand with RDF showing all literals, the last item would be written out asfollows: Horn Fly redKansas The two different namespace literals are both resource attributes.haematobia_irritans is used as the resource identifier because it is aunique value among all data.Laying out the data in the same pattern gives you the final, full RDF file inExample 10-4.Example 10-4. Entire RDF file fly:label=Stable Fly fly:color=black/> Example 10-4 shows the RDF data used in several template examples inChapter 9. Example 9-4 includes the 10-4.rdf datasource, as do many ofthose templates. You can copy the data out of Example 10-4 and into a fileof the same name to use as a datasource.10.2. The Mozilla Content ModelOne theme of this book -- and a general goal of the Mozilla developmentenvironment -- is that developers can create real applications using many ofthe same technologies they use to create a web page. The Gecko renderingengine, sitting at the heart of Mozilla and happily rendering web content,XML files, XUL interfaces, and whatever else they can support, is whatmakes this type of development possible. But how does Gecko know what torender and how? How can RDF data be handed over so that Gecko knowshow to draw it?When a browser uses the same engine to draw everything -- its own interfaceas well as the various kinds of content it supports -- that engine treatseverything as content. Gecko needs a way to understand all the various partsof the Mozilla browser itself -- such as the sidebar, the toolbars, and the mailfolders and mail messages -- as resources it can render and display in theMozilla chrome. This approach to the Mozilla application interface is calledthe content model.In Mozillas content model, XUL documents and other interface resourcesare transformed into RDF when they are read. Each chunk of content isrepresented as a separate RDF datasource (see the next section, Section10.2.1, for more information) and is then fed to the XUL Content Builderand rendered as the actual bits on the screen, as Figure 10-9 shows.Figure 10-9. Diagram of Mozillas content modelAs you can see in Figure 10-9, the content model can be complex. The XULdocuments in Figure 10-9 are files such as navigator.xul, whichdefines the main browser windows basic layout; the RDF documentsinclude files like help-toc.rdf, which defines the Mozilla Help viewerstable of contents. The list of mail folders and accounts shown in Example10-5 are part of the built-in data that Mozilla renders into browser content.Whatever the source, the content model gets everything processed in-memory as RDF so that any data can be combined and formatted into XULor other interface code. All sources of RDF data are called datasources.10.2.1. DatasourcesA datasource is a collection of related, typically homogenous, RDFstatements. A datasource may be a single RDF file likelocalstore.rdf, a combination of files, or RDF structures that existonly in me ...
Nội dung trích xuất từ tài liệu:
Creating Applications with Mozilla-Chapter 10. RDF, RDF Tools, and the Content Model -P2 Chapter 10. RDF, RDF Tools, and the Content Model -P2This files root resource is an urn:root, which is the conventional namefor root nodes in Mozillas RDF files. When rendering RDF files, defining aroot node for processing the document can be useful -- especially whenbuilding templates. This root node can be entered as the first item in the file: 10.1.3.3. Root sequenceNext, a generic tag needs to be used to specify a sequence of fly data. Asin Example 10-2, is used as a list of fly types. This tag is ageneric name because of the way XUL templates process lists of RDF data.If a list of data has sublists, as in the following examples, then they must usethe same tag name to recurse correctly for the data they contain.Example 10-2 represents all the information given in the first paragraph ofthe text example: There is a jar set up with the name urn:root. Inside ofit there are two types of flies, listed as House and Horse.Example 10-2. RDF root sequence An RDF sequence resides with its list of resources inside .Here, shorthand RDF specifies a label with the fly:label attribute. TheID attribute within this sequence is actually a pointer to the main definitionof the resource described by an about attribute of the same value. Theabout attribute includes a # in its identifier, much like HTML anchors use to refer to . For example,ID=Horse points to about=#Horse elsewhere in the file, allowingyou to add to the description of any element with new properties andresources.10.1.3.4. Secondary sequences and literalsThe Horse and House resources need to be defined next. Example 10-3shows the creation of Horse from the second paragraph. The process forcreating House is almost identical.Example 10-3. The Horse sequence Here the shorthand RDF definition continues to use only the attributes.Again, a is defined and the items inside it are listed. Thelisted values have multiple attribute values, all of which are RDF literals. Inlonghand with RDF showing all literals, the last item would be written out asfollows: Horn Fly redKansas The two different namespace literals are both resource attributes.haematobia_irritans is used as the resource identifier because it is aunique value among all data.Laying out the data in the same pattern gives you the final, full RDF file inExample 10-4.Example 10-4. Entire RDF file fly:label=Stable Fly fly:color=black/> Example 10-4 shows the RDF data used in several template examples inChapter 9. Example 9-4 includes the 10-4.rdf datasource, as do many ofthose templates. You can copy the data out of Example 10-4 and into a fileof the same name to use as a datasource.10.2. The Mozilla Content ModelOne theme of this book -- and a general goal of the Mozilla developmentenvironment -- is that developers can create real applications using many ofthe same technologies they use to create a web page. The Gecko renderingengine, sitting at the heart of Mozilla and happily rendering web content,XML files, XUL interfaces, and whatever else they can support, is whatmakes this type of development possible. But how does Gecko know what torender and how? How can RDF data be handed over so that Gecko knowshow to draw it?When a browser uses the same engine to draw everything -- its own interfaceas well as the various kinds of content it supports -- that engine treatseverything as content. Gecko needs a way to understand all the various partsof the Mozilla browser itself -- such as the sidebar, the toolbars, and the mailfolders and mail messages -- as resources it can render and display in theMozilla chrome. This approach to the Mozilla application interface is calledthe content model.In Mozillas content model, XUL documents and other interface resourcesare transformed into RDF when they are read. Each chunk of content isrepresented as a separate RDF datasource (see the next section, Section10.2.1, for more information) and is then fed to the XUL Content Builderand rendered as the actual bits on the screen, as Figure 10-9 shows.Figure 10-9. Diagram of Mozillas content modelAs you can see in Figure 10-9, the content model can be complex. The XULdocuments in Figure 10-9 are files such as navigator.xul, whichdefines the main browser windows basic layout; the RDF documentsinclude files like help-toc.rdf, which defines the Mozilla Help viewerstable of contents. The list of mail folders and accounts shown in Example10-5 are part of the built-in data that Mozilla renders into browser content.Whatever the source, the content model gets everything processed in-memory as RDF so that any data can be combined and formatted into XULor other interface code. All sources of RDF data are called datasources.10.2.1. DatasourcesA datasource is a collection of related, typically homogenous, RDFstatements. A datasource may be a single RDF file likelocalstore.rdf, a combination of files, or RDF structures that existonly in me ...
Tìm kiếm theo từ khóa liên quan:
thủ thuật máy tính công nghệ thông tin tin học quản trị mạng computer networkTài liệu liên quan:
-
52 trang 439 1 0
-
24 trang 366 1 0
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 329 0 0 -
Làm việc với Read Only Domain Controllers
20 trang 321 0 0 -
74 trang 309 0 0
-
96 trang 305 0 0
-
Báo cáo thực tập thực tế: Nghiên cứu và xây dựng website bằng Wordpress
24 trang 299 0 0 -
Đồ án tốt nghiệp: Xây dựng ứng dụng di động android quản lý khách hàng cắt tóc
81 trang 291 0 0 -
Tài liệu dạy học môn Tin học trong chương trình đào tạo trình độ cao đẳng
348 trang 291 1 0 -
EBay - Internet và câu chuyện thần kỳ: Phần 1
143 trang 278 0 0