Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
PHP 5 Recipes A Problem-Solution Approach PHẦN 9
Đang chuẩn bị liên kết để tải về tài liệu:
PHP 5 Recipes A Problem-Solution Approach PHẦN 9
Hải Vân
61
68
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Ví dụ tiếp theo cho thấy làm thế nào để loại bỏ việc tạo ra và phụ thêm các thuộc tính và chỉ đơn giản là chỉ định các thuộc tính cần thiết đến các yếu tố mà bạn cần họ.Trong ví dụ này, bạn tạo ra và thêm các thuộc tính của cây để các phần tử bảng và giao cho một số giá trị. Sản lượng sau đó sẽ như thế này | 522 14-4 CREATING AND SETTING ATTRIBUTES How It Works In this example you create and append the tree attributes to the table element and assign them some values. The output will then look like this html body table width 100 height 50 border 1 tr td value1 td td value2 td tr table body html Because attributes are automatically created you can reduce this example a bit without impacting the result. The next example shows how to remove the creation and appending of attributes and simply assign the needed attributes to the elements where you need them. The Code php Example 14-4-2.php root new DomDocument 1.0 iso-8859-1 html root- createElement html body root- createElement body table root- createElement table table- setAttribute width 100 table- setAttribute height 50 table- setAttribute border 1 row root- createElement tr cell root- createElement td value1 row- appendChild cell cell root- createElement td value2 row- appendChild cell table- appendChild row body- appendChild table html- appendChild body root- appendChild html echo root- saveHTML The DomElement object also includes methods to check for the existence of an attribute remove an attribute and get the value of an attribute. The methods are called hasAttribute removeAttribute and getAttribute . These functions all take the attribute name as the only parameter. 14-5 PARSING XML 523 14-5. Parsing XML So far we have been discussing generating HTML and XML documents but you can also use the DOM extension to load and parse both HTML and XML documents. Unlike XML documents HTML documents do not have to be well formatted browsers can render HTML documents with missing end tags so it is likely to see errors or warnings when these documents are loaded. The DomDocument class includes methods to parse string values as HTML or XML and methods to load the content directly from a file or as a stream. The next example does not make much sense but it demonstrates how to read the HTML content directly from a Uniform Resource
TÀI LIỆU LIÊN QUAN
PHP 5 Recipes A Problem-Solution Approach 2005 phần 5
PHP 5 Recipes A Problem-Solution Approach PHẦN 5
PHP 5 Recipes A Problem-Solution Approach
PHP 5 Recipes A Problem-Solution Approach 2005 phần 1
PHP 5 Recipes A Problem-Solution Approach 2005 phần 2
PHP 5 Recipes A Problem-Solution Approach 2005 phần 3
PHP 5 Recipes A Problem-Solution Approach 2005 phần 4
PHP 5 Recipes A Problem-Solution Approach 2005 phần 6
PHP 5 Recipes A Problem-Solution Approach 2005 phần 7
PHP 5 Recipes A Problem-Solution Approach 2005 phần 8
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.