xmlpullparser의 setNamespaceAware :: 소림사의 홍반장!

xmlpullparser의 setNamespaceAware

2012. 3. 21. 12:18 - 삘쏘굿

글쎄 머.. 정확하게 이해하지는 못했지만 이정도라도 나중에 까먹지 않기 위하여..


setNamespaceAware

public void setNamespaceAware(boolean awareness)
                       throws XmlPullParserException
Specifies that the parser produced by this factory will provide support for XML namespaces. By default the value of this is set to false.

Parameters:
awareness - true if the parser produced by this code will provide support for XML namespaces; false otherwise.
Throws:
XmlPullParserException

일단 API에 나와있는 내용.. namespace를 인지할것인지 안할것인지에 대한 내용이다.

실제 사용은

xmlPullParserFactor.setNamespaceAware(true);

요렇게 하고 디폴트값은 false이다.

일단 namespace란




	99SessionTest
	
		index.html
		default.jsp
	


 

머 이런식으로 되어있는xml이 있다고 하면 태그부분에 xmlns, 여기서ns가

namespace이고

xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

요런식으로 사용한단다.

그러면 태그에서 <web:person> 이런식으로 사용하면 중복되는 태그없이 고유값으로

사용할수 있다는 것이다.

완벽히 이해는 못하겠지만 앞으로 xmlpullparser사용시 setNamespaceAware값은

true로 명시해주는게 나을듯?? 아닌가?ㅎㅎ

다른 카테고리의 글 목록

Dev. 안드로이드/API 및 이론 카테고리의 포스트를 톺아봅니다