Java Siege Lion Road-review xml&dom_pull programming

Source: Internet
Author: User
Tags cdata html comment

Xml&dom_pull Programming:

1. Remove the Welcome pop-up window interface: Enter "Configuration Center" in the Preferences option of the window item to find this item and
Tick the box and check it out.

2. Remove the pop-up when opening myeclipse: Allow Subclipse team to receive ... Way:

Windows-->preferences-->general-->startup and shutdown--> cancel subclipse Usage Reporting check box

MyEclipse8.5
1, the Configuration workspace-----recommended not to use the inclusion of spaces and Chinese directories
All code saved in workspace space
2, when the new project, set up the project requires the JRE environment
MyEclipse offers a variety of built-in layouts---each layout interface, different menus
Properties of the project
Encoding set---When importing other projects, be aware of the same encoding type
The Java build path sets the classpath location, specifying that the current project introduces the class library
Specify the. java file and the. class file location in source
Librialies specifying the current project reference class library
Java Compiler Specifies that Java uses that version to compile the. class file-----Compiler version
When the JRE version is lower than the compiler version: Bad version number in. class file

3. Grouping working set for already existing projects
Do not need to use the project by grouping hide

4. Shortcut keys
alt+/Content Assist Template Key---quickly complete the code----Windows Preferences Java Editor Templates
Ctrl+1 Quick Fix provides code modification recommendations
* Use alt+/to modify shortcut Keys Set window Preferences general---keys
* Formatting Windows Preferences when saving code Java-editor-save actions

Program debugging
Java Programmer Core Competencies---code debug capability
1, the current code error---View the error message---Find where the error occurred
* From the top down to find the first line you write the program
2, based on experience to guess the cause of the error
Print critical data information to the console via Sysout or log technology
View critical location data-----Breakpoints Debug Break point-----Program runs through debug as by using Eclipse's breakpoint debugging feature
* F5 and F7 are used together to see the specific code implementation F6 use to jump directly to the next line of code
F3 View Class Code
F4 Viewing class inheritance relationships

About Code Testing-----Testing: white-box testing and black-box testing
White box test test code structure and logic (visible Code test), black box test test code function and performance (invisible Code test)
* White box Test limitations 1, white box test can not test all code 2, white box testing is relatively difficult--white box test to the Software Development engineer to measure themselves.
Monomer test is a white box test, test Code function module--Test code single function

JUnit is a single test technique for Java
1. Write JUnit to reference JUnit class library in engineering
2. Write single test case
* Create a method with no parameters for public void, add @test annotations before the method
3, each test method is equivalent to the previous writing main function, each test method can be executed separately

When testing with JUnit, there are a lot of methods, and each method outputs the content to the console, and people can't check it manually.
* Automated results Check---assert assert
Assertion principle: Call method, prepare test data before calling method, test data run result----Compare actual result with expected result

* When writing a single test, do not test only the correct data and results, test incorrect data (illegal data)

XML technology: Data-related technologies, XML technology commonly used in enterprises to store data and transmit data, popular reason--XML is independent of any programming language
XML can be used in any programming language of PHP, Java,. Net
* Tag Data with tags

What is a markup language?
<xxx>aaa</xxx> Typical Markup Language HTML----to decorate text information with markup

XML tags are arbitrarily defined---extensible
XML typical storage and transport applications:
1, the XML serves as the database holds the data information---the question which saves in the XML, the Google data information saves in the XML format
2, in the Ajax transmission of data, WebService technology network transmission of data, the format of the use of XML
Many tags are pre-defined in HTML, and each tag has a corresponding display, and all XML tags are not predefined
In XML <name>HLG</name>----want to determine the meaning of the name tag, you need to add a constraint to the XML

XML syntax
1. Document Declaration
2. Elements
3. Properties
4. Comments
5. CDATA Blocks
6. Processing instructions

Any XML must have a document declaration <?xml version= "1.0"?>

XML is a markup language for storing and transmitting data---saving data content
XML encoding set is not specified---by default iso-8859-1 encoding (Chinese data not supported)
* Note the problem when XML specifies encoding= "Utf-8" is a browser view encoding set--The browser view encoding set must be consistent with the file save encoding set
* The new Notepad program uses the system default encoding set---The default encoding set GBK----save using UTF-8 encoding as

When declaring standalone = "yes" the XML is independent XML does not depend on other files outside, standalone = "No" The XML relies on some external files

XML describes complex relational model data through elements

XML Syntax specification
1. All XML elements must end
<abc></abc>-----In the XML file if the label does not have content self-ending <abc/>
2, the label does not allow cross-nesting
3. Have and have only one root element
4, the XML file hollow lattice and the change is parsed by the parser
5, strictly case-sensitive, element and attribute names cannot start with a number

Property definition Syntax < element Name Property name = "Property Value" Property name = "Property value" ....>
One element defines multiple attributes, and each attribute value must use single and double quotation marks
6, the value of the attribute must be enclosed in single or double quotation marks
7. XML comment Same as HTML comment <!----> comment cannot be nested

CDATA Content that is not parsed by the parser in a zone----usually holds special code that causes confusion in the XML format
What are the conditions in which CDATA and escape characters are used? Difference?
* Prioritize using CDATA XML technology to store data, transfer data, parse data

8. control the XML display style via PI instruction (no comment before instruction)
When XML uses PI directives to refer to CSS---effect is equivalent to HTML for page data presentation
* display data through XML, with XSLT decorated XML data display (CSS-like)

The application of XML technology in two major categories
1. Transfer and storage of data-----programmers to simplify development, do not use constraint techniques for XML
* XML formatting is not necessarily correct without the use of XML constraint techniques
* All XML data content generation, parsing process is done by the program
2. Using XML as a configuration file
Android SSH-----Programmer in order to ensure the accuracy of XML elements, usually the XML document uses the constraint technology

What XML uses constraints? Using constrained XML documents---element content format more canonical
Code is simpler if the XML is not used in the enterprise------The XML is generated by the program and the XML is parsed without constraints

XML constraint technology DTD and Schema

Quick Start with DTD technology
1. Write Data XML---books.xml
2. Writing DTD files
* For each element of the document (different name) <! ELEMENT
Grammar <! Element name Sub-element >
Element inner text #PCDATA
3. Associating an XML file with a DTD file

<?XML version= "1.0" encoding= "UTF-8"?><?xml-stylesheet type= "text/css" href= "1.css "?> <!DOCTYPE Books SYSTEM "Books.dtd"><Books>    < Book>             <name>Java Programming Ideas</name>             < Price>30.0</ Price>    </ Book></Books>
books.xml
<? XML version= "1.0" encoding= "UTF-8" ?> <!  ><! ELEMENT Book (name,price) > <! ELEMENT name (#PCDATA) > <! ELEMENT Price (#PCDATA) >
BOOKS.DTD
@CHARSET "UTF-8"; name {    color:red;}
1.css

Java Siege Lion Road-review xml&dom_pull programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.