TAILIEUCHUNG - Java 2 Bible Enterprise Edition phần 5

XLST biến đổi bằng cách sử dụng JDOM Vì vậy, bạn đã sử dụng JAXP để biến đổi sử dụng . Bạn cũng có thể viết chương trình Java của bạn bằng cách sử dụng JDOM thay vì Chương 14: Chuyển đổi và đóng tài liệu XML của bạn | Chapter 14 Transforming and Binding Your XML Documents head title xsl value-of select TITLE title head body h1 xsl value-of select TITLE h1 xsl apply-templates select ACT body html xsl template xsl template match ACT xsl apply-templates xsl template xsl template match SCENE xsl apply-templates xsl template xsl template match SPEECH br xsl apply-templates xsl template xsl template match SPEAKER br b xsl apply-templates b xsl template xsl template match TITLE br h2 xsl apply-templates h2 xsl template xsl template match STAGEDIR br em xsl apply-templates em xsl template xsl template match LINE br xsl apply-templates xsl template xsl stylesheet XLST transformations using JDOM So far you ve used JAXP to transform using . You could also have written your Java program using JDOM instead of JAXP. Just like the JAXP program Transform1 Transform2 is an adaptation of CueMyLine5. In Chapter 13 you created this program to make changes to by using JDOM and then saved the changes. You may need to refer back to Chapter 13 to review setting up your computer to run JDOM applications. Here s a partial listing of the JDOM version of CueMyLine5java package cue imports 276 Chapter 14 Transforming and Binding Your XML Documents public class CueMyLine5 Document document public CueMyLine5 try SAXBuilder builder new SAXBuilder document new File catch JDOMException e There s a JDOM problem. public void addPrologue . public void saveTheDocument try XMLOutputter xmlOutputter new XMLOutputter true true document new FileWriter catch Exception e Transformer Config Exception public static void main String args CueMyLine5 cueMyLine new CueMyLine5 As with Transforml other than renaming the class and methods you need to make surprisingly few alterations. You will create in the

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.