org.teldap.core.xmlvalidator.util.wellform
Class AttrQuot_EntityReference

java.lang.Object
  extended by org.teldap.core.xmlvalidator.util.wellform.AttrQuot_EntityReference

public class AttrQuot_EntityReference
extends java.lang.Object

Copyright 2009 數位典藏與數位學習國家型科技計畫(TELDAP) 數位核心平台計畫

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Title: XML文件需符合良好格式1

Version:
1.0
Author:
徐慈妍、洪崇熙、洪國翔

Field Summary
static java.util.regex.Pattern attrPattern
           
static java.util.regex.Pattern tagPattern
           
 
Constructor Summary
AttrQuot_EntityReference(java.io.File xml)
           
 
Method Summary
 boolean checkAttributeQuot()
          屬性值必須包在雙引號(" ")內,且標籤命名須符合規則。
 boolean checkDuplicateAttr()
          同一個標籤內的屬性不可重複:譬如<Title field="xxxx" field="xdddx">
 boolean checkEntitiyReference()
          XML特殊字元是否用字元參引(Entity Reference)取代
 java.util.HashMap collectMsg()
           
 void getTagsAndAttr()
          解析XML檔案內所有的標籤、標籤間的文字及屬性對(ex:Creator="長榮大學視覺藝術學系"),並分別集合在各自的ArrayList
 java.lang.String getXMLContent(java.io.File file)
           
 boolean hasSpecialChar(java.lang.String text)
          是否有XML的5個特殊字元
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tagPattern

public static java.util.regex.Pattern tagPattern

attrPattern

public static java.util.regex.Pattern attrPattern
Constructor Detail

AttrQuot_EntityReference

public AttrQuot_EntityReference(java.io.File xml)
Method Detail

getXMLContent

public java.lang.String getXMLContent(java.io.File file)

checkAttributeQuot

public boolean checkAttributeQuot()
屬性值必須包在雙引號(" ")內,且標籤命名須符合規則。標籤命名規則如下:

Returns:
boolean true-屬性值在雙引號內且標籤命名符合規則

checkDuplicateAttr

public boolean checkDuplicateAttr()
同一個標籤內的屬性不可重複:譬如<Title field="xxxx" field="xdddx">

Returns:
boolean true-屬性重複

getTagsAndAttr

public void getTagsAndAttr()
解析XML檔案內所有的標籤、標籤間的文字及屬性對(ex:Creator="長榮大學視覺藝術學系"),並分別集合在各自的ArrayList


checkEntitiyReference

public boolean checkEntitiyReference()
XML特殊字元是否用字元參引(Entity Reference)取代

Returns:
boolean true-特殊字元已用字元參引取代

hasSpecialChar

public boolean hasSpecialChar(java.lang.String text)
是否有XML的5個特殊字元

Returns:
true-未含有特殊字元

collectMsg

public java.util.HashMap collectMsg()