I mentioned in the previous blog that the getProperty() method under the class XSDSchemaAdapter in org.eclipse.wst.xsd.core, XSDImpl.java calculates the name space of an attribute. However, as i looked more into the code, I found that the getProperty() method does not do more than retrieving the value from a created attribute. So, to find out how the name space of an attribute is calculated, I would need to look into the code where an attribute is created.
First, I go back to org.eclipse.wst.xml.core, DOMContentBuilderImpl.java and find out the method creating an element, which is visitCMElementDeclaration(). In visitCMElementDeclaration(), the following line of code is trying to creat the attributes of an element.
CMNamedNodeMap nodeMap = ed.getAttributes();
When ed is passed to visitCMElementDeclaration(), it is claimed to be an instance of CMElementDeclaration, but it is actually of data type XSDElementDeclarationAdapter derived from ElementDeclarationBaseImpl. XSDElementDeclarationAdapter and ElementDeclarationBaseImpl are both defined in org.eclipse.wst.xsd.core, XSDImpl.java.getAttributes() is one of the methods defined in ElementDeclarationBaseImpl. The following lines of code in getAttributes() are creating the attributes of an element.
XSDComplexTypeDefinition ctd = (XSDComplexTypeDefinition) xsdTypeDefinition;
for (Iterator i = ctd.getAttributeUses().iterator(); i.hasNext();) {XSDAttributeUse xsdAttributeUse = (XSDAttributeUse) i.next();
XSDAttributeUseAdapter adapter = (XSDAttributeUseAdapter)getAdapter(xsdAttributeUse);
if (adapter != null && adapter.getNodeName() != null) {
map.getHashtable().put(adapter.getNodeName(), adapter);
}
}
The most important variable in the these lines is ctd, which is corresponding to the definition of an element. XSDComplexTypeDefinition is defined in org.eclipse.xsd_2.5.0.v200905041408.jar in the plug-in dependencies folder. At this point, the "lang" attribute still gets the correct name space url, which is http://www.w3c.org/XML/1998/namespace. However, once the CMNode, representing the "lang" attribute, is converted to CMDocument later in DOMNamespaceHelper.java, the namespace url, for some unknown reason, has been changed to http://java.sun.com/xml/ns/javaee, which I think is the cause of Bug 245698
nice job! waiting for your new artical...................................................
ReplyDelete您的部落格文章真棒!!有空我一定會常來逛!!........................................
ReplyDelete從人生中拿走友誼,猶如從生活中移走陽光........................................
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteWell begun is half done.......................................................
ReplyDeleteBetter say nothing than nothing to the purpose. ........................................
ReplyDelete死亡是悲哀的,但活得不快樂更悲哀。 ..................................................
ReplyDeleteNice to meet you~!!!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReplyDelete上床圖片av圖片免費色情圖台灣性網陰蒂淫妹貼圖色情激突成人論壇成人色情網激情成人聊天室情色影音鹹濕女生自慰影片淫慾自慰色情a片成人色情圖片網情人視訊網成人話題成人色情台灣成人淫蕩a圖片情色留言板女生奶頭情色成人全裸美女圖片情色寫真裸體照大奶子台灣色情成人網站一夜正妹美女裸體寫真g罩杯美女sex520情趣娃娃視訊打槍視訊辣妹uthome淫亂走光照av情色網女生高潮成人自拍火辣眉眉太太陰毛美女視訊聊天全裸入鏡火辣av三點全露
ReplyDelete當一個人內心能容納兩樣相互衝突的東西,這個人便開始變得有價值了。...............................................................
ReplyDeleteApril showers bring May flowers..............................................
ReplyDelete思想與理論,貴呼先於行動,但行動較思想或理論更高貴..................................................
ReplyDelete河水永遠是相同的,可是每一剎那又都是新的。...........................................................................
ReplyDelete一棵樹除非在春天開了花,否則難望在秋天結果。 ..................................................
ReplyDelete請繼續發表好文!加油加油再加油! .................................................................
ReplyDelete你真的很棒~謝謝分享囉~......................................................................
ReplyDeleteQuality is better than quantity.................................................................
ReplyDeletepleasure to find such a good artical! please keep update!!.................................................................
ReplyDelete所有的資產,在不被諒解時,都成了負債............................................................
ReplyDelete噴泉的高度,不會超過它的源頭。一個人的事業也是如此,它的成就絕不會超過自己的信念。.................................................................
ReplyDelete這BLOG真是讓人意猶未盡!!..................................................................
ReplyDelete喜歡看大家的文章,每篇都是一個故事,都是一種心情~~祝大家開心愉快............................................................
ReplyDeletefaith will move mountains. ..................................................
ReplyDelete我來湊熱鬧的~~^^ 要平安快樂哦............................................................
ReplyDelete世間事沒有一樣沒有困難,只要有信心去做,至少可以做出一些成績。..................................................
ReplyDeleteMake yourself necessary to someone..................................................................
ReplyDelete值得一看再看的格子,多謝分享.................................................................
ReplyDelete好久沒有這樣輕鬆享受閱讀的樂趣了~~留個言邀您分享我的快樂~~..................................................................
ReplyDelete愛情是一種發明,需要不斷改良。只是,這種發明和其他發明不一樣,它沒有專利權,隨時會被人搶走。.................................................................
ReplyDelete這個部落格好好好~棒棒棒............................................................
ReplyDelete人們不缺少力量,他們缺少意志。..................................................
ReplyDelete走召糸及言贊白勺口拉............................................................
ReplyDelete愛情是盲目的,但婚姻恢復了它的視力。..................................................................
ReplyDelete愛,拆開來是心和受兩個字。用心去接受對方的一切,用心去愛對方的所有。......................................................................
ReplyDelete來給你加油打氣!!!保重!!!............................................................
ReplyDelete所有的資產,在不被諒解時,都成了負債............................. ....................................
ReplyDelete困難的不在於新概念,而在於逃避舊有的概念。......................................................................
ReplyDelete