XML questions

1.Which is better to store data as elements or as attributes?

2.Why use an XML document as opposed to other types of documents like a text file etc?

3.Explain where your project needed XML documents?
config and transfer data

4.How do you write comments in an XML document?
<!-- 这里写注释-->

5.How will you embed an XML content within an XML document?

6.How do you write an attribute value with single quotes? How do you write an element value of “> 500.00”?
XML 属性名称是区分大小写的,比如 Name 和 name 就表示两个不同的属性。
XML 属性的值应用引号围起来,你可以用双引号,也可以用单引号,以下的写法都是正确的。不过通常来说,XML 属性采用双引号。
<book ISBN ="9787544238212">
<book ISBN ='9787544238212'>
如果属性的值里包含双引号,就用单引号包围属性值,比如:
<site info ='wo"you"xian.net'>
如果属性值里包含单引号,就用双引号包含属性值。
<site info ="wo'you'xian.net">

7.What is a well-formed XML document?

8.What is XPATH? What is XSLT/XSL/XSL-FO/XSD/DTD etc? What is JAXB? What is JAXP?
XPath 是一门在 XML 文档中查找信息的语言。XPath 用于在 XML 文档中通过元素和属性进行导航。
  什么是 XPath?
  XPath 使用路径表达式在 XML 文档中进行导航
  XPath 包含一个标准函数库
  XPath 是 XSLT 中的主要元素
  XPath 是一个 W3C 标准

XSLT是扩展样式表转换语言(Extensible Stylesheet Language Transformations)的简称,这是一种对XML文档进行转化的语言,XSLT中的T代表英语中的“转换”(transformation)。它是XSL(Extensiblestylesheetlanguage)规范的一部分。

[url]http://www.w3school.com.cn/xslfo/xslfo_intro.asp[/url]

JAXB(Java Architecture for XML Binding) 是一个业界的标准,是一项可以根据XML Schema产生Java类的技术。该过程中,JAXB也提供了将XML实例文档反向生成Java对象树的方法,并能将Java对象树的内容重新写到XML实例文档。从另一方面来讲,JAXB提供了快速而简便的方法将XML模式绑定到Java表示,从而使得Java开发者在Java应用程序中能方便地结合XML数据和处理函数。

JDK中JAXB相关的重要Class和Interface:
  JAXBContext类,是应用的入口,用于管理XML/Java绑定信息。
  Marshaller接口,将Java对象序列化为XML数据。
  Unmarshaller接口,将XML数据反序列化为Java对象。

JAXP是Java API for XML Processing的英文字头缩写,中文含义是:用于XML文档处理的使用Java语言编写的编程接口。JAXP支持DOM、SAX、XSLT等标准。为了增强JAXP使用上的灵活性,开发者特别为JAXP设计了一个Pluggability Layer,在Pluggability Layer的支持之下,JAXP既可以和具体实现DOM API、SAX API 的各种XML解析器(XML Parser,例如Apache Xerces)联合工作,又可以和具体执行XSLT标准的XSLT处理器(XSLT Processor,例如Apache Xalan)联合工作。
  由于问题太多,从JDK1.7开始删除该功能。

[b]web service:[/b]
1.How would you publish and find WSDL descriptions? What are the 4 primary UDDI data types?
[url]http://www.w3school.com.cn/wsdl/index.asp[/url]
[url]http://www.w3school.com.cn/wsdl/wsdl_uddi.asp[/url]

2.How can a client application make a request to a Web service?

3.What is Apache AXIS?
[url]http://blog.csdn.net/java_xiang/article/details/1639011[/url]

4.What is WSDL? How would you use a WSDL file?
[url]http://blog.csdn.net/top_keki/article/details/4056464[/url]

5.What is a Web service, and how does it relate to SOAP? What is a common transport for SOAP messages?
[url]http://www.w3school.com.cn/webservices/index.asp[/url]
[url]http://www.w3school.com.cn/soap/index.asp[/url]

6.Why use Web services when you can use traditional style middleware such as RPC, CORBA, RMI and DCOM?
MyBatis Mapper XML is a configuration file used in MyBatis, a Java-based persistence framework, to define SQL mappings between Java objects and database tables. The Mapper XML file contains SQL statements and mapping rules that are used to interact with the database. In the Mapper XML file, you define the SQL statements such as SELECT, INSERT, UPDATE, DELETE, etc., using the MyBatis XML syntax. You also define the mapping rules to map the result of the SQL queries to Java objects or vice versa. Here is an example of a simple Mapper XML file: ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.example.UserMapper"> <select id="getUserById" resultType="com.example.User"> SELECT * FROM users WHERE id = #{id} </select> <insert id="insertUser" parameterType="com.example.User"> INSERT INTO users (id, name, email) VALUES (#{id}, #{name}, #{email}) </insert> <update id="updateUser" parameterType="com.example.User"> UPDATE users SET name = #{name}, email = #{email} WHERE id = #{id} </update> <delete id="deleteUser" parameterType="int"> DELETE FROM users WHERE id = #{id} </delete> </mapper> ``` In this example, the Mapper XML file defines four SQL statements: `getUserById`, `insertUser`, `updateUser`, and `deleteUser`. Each statement has an ID, parameterType (input parameter), resultType (output result mapping), and the actual SQL query. You can then use the defined SQL statements in your Java code by referencing the Mapper XML file and the statement ID using MyBatis API. Note that the actual mapping between Java objects and database tables is usually done through Java annotations or XML configuration files in addition to the Mapper XML file. The Mapper XML file primarily focuses on defining the SQL statements and their mappings. I hope this gives you a basic understanding of MyBatis Mapper XML. Let me know if you have any further questions!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值