« Previous : 1 : 2 : 3 : 4 : 5 : ... 11 : Next »

xpath와 namespace

Hey all,

Simple question, I just want to select the text from the <Template> tag. Here's what I have, but the Xpath doesn't match anything.

public static void TestXPath()
{
string xmlText = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
xmlText += "<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">";
xmlText += "<Template>Normal</Template> <TotalTime>1</TotalTime> <Pages>1</Pages> <Words>6</Words>";
xmlText += "</Properties>";

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(new System.IO.StringReader(xmlText));

foreach (XmlNode node in xmlDoc.SelectNodes("//Template"))
{
Console.WriteLine("{0}: {1}", node.Name, node.InnerText);
}
}


You need to use an XmlNamespaceManager because the
Template element is in a namespace:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(new System.IO.StringReader(xmlText));
XmlNamespaceManager manager = new XmlNamespaceManager(xmlDoc.NameTable);
manager.AddNamespace("ns",
"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties");

foreach (XmlNode node in xmlDoc.SelectNodes("//ns:Template", manager))
{
Console.WriteLine("{0}: {1}", node.Name, node.InnerText);
}

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 솔라뷰

2010/03/02 13:09 2010/03/02 13:09
Response
No Trackback , No Comment
RSS :
http://www.solarview.net/rss/response/285

MatLAB 7.2를 Windows7에 설치하기

MatLAB 7.2를 Windows7에 설치하려다 에러가 발생해서 아래 웹페이지에서 해결책을 찾았다.
웹페이지 : http://www.4kg.net/node/12339

Q. Matlab 7.4를 windows7에 설치하려고 했는데 에러를 하나 밷어내고 멈춰버립니다. or Matlab이 Windows7에서 실행되지 않습니다.

A-1. Windows 테마를 "Windows 고전"으로 변경하면 됩니다. 다만 이 경우 Windows7의 자랑인
       Aero peek을 사용할 수 없습니다.

A-2. Matlab 내부의 Java를 최신버전으로 교체합니다. 방법은 다음과 같습니다.

1) Java 최신 버전을 다운받고, 인스톨합니다.
2) \sys\java\jre\win32에 가보면  jre1.5.0_07 혹은 비슷한 이름의 폴더를
    볼 수 있습니다. 그 폴더의 이름을 Original_jre1.5.0_07으로 변경합니다.
3) C:\Program Files\Java 위치에 가서 jre6 폴더를 \sys\java\jre\win32로
   복사/붙여넣기 합니다.
4) jre6 폴더의 이름을 jre1.5.0_07과 같이 2)에서의 원래 폴더 이름으로 변경합니다.


   ( A-2 내용 출처 : Matlab 7 under Windows 7 )

<주의!> A-1, A-2의 두 방법을 모두 이용해서 Matlab을 구동해도
             "HELP창에 내용이 나타나지 않는 문제"가 발생합니다.
그러니까, 결론적으로 '구식테마로 전환한 다음 매트랩을 설치하라'는 말이 되겠다.

이때 사용한 구글의 검색어는 "matlab 7 under windows7"이었다.
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 솔라뷰

2009/11/23 10:31 2009/11/23 10:31
Response
No Trackback , No Comment
RSS :
http://www.solarview.net/rss/response/281

[웹페이지]FireFox 활용팁

FireFox 활용팁

http://www.choboweb.com/62?category=23
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 솔라뷰

2009/10/14 20:11 2009/10/14 20:11
Response
No Trackback , No Comment
RSS :
http://www.solarview.net/rss/response/279

Terminal Emulator

서버에 접속하기 위해서는 터미널 에뮬레이터가 필요하다.
오늘까지 SecureCRT를 주로 애용했었는데, 한글표현이 안되어서 잠시 접었다.
대신 PuTTY를 처음으로 사용해봤다.
한 마디로 가볍고 야무졌다. 그것도 파일 하나로 모든 것이 처리되나니!
더군다나 공짜다!

[내려받기 웹페이지]
http://www.chiark.greenend.org.uk/~sgtatham/putty/

[참고할 만한 웹페이지]
- 푸티를 위한 화면 설정
- 푸티의 다양한 기능
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 솔라뷰

2009/08/24 21:23 2009/08/24 21:23
,
Response
No Trackback , No Comment
RSS :
http://www.solarview.net/rss/response/273

Ubuntu Server에 원격접속시(SSH) 한글이 되도록 하는 법

1) 한글설치
#locale-gen ko_KR.UTF-8
2) /etc/environment  파일 편집
#vi /etc/environment
LANG="ko_KR.UTF-8"  <-- 추가
3) /etc/profile 파일 편집
#vi /etc/profile
LANG="ko_KR.UTF-8" <--추가
4) 사용자(여기서는 root)의 프로파일(/root/.profile) 편집
#vi /root/.profile
# LANG=C    <-- 주석처리
# LANGUAGE=C
위의 두 곳을 주석처리(#)
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 솔라뷰

2009/08/24 12:55 2009/08/24 12:55
Response
No Trackback , No Comment
RSS :
http://www.solarview.net/rss/response/272

winmail.dat 파일 열기

winmail.dat 파일을 열어 달라는 부탁을 받았다. 검색결과 아래의 사이트를 통해서 문제를 해결할 수 있었다.

[참고문헌]
http://widelake.net/434
http://www.eolsoft.com/freeware/winmail_opener/
http://arome2.tistory.com/30
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 솔라뷰

2009/08/20 12:44 2009/08/20 12:44
Response
No Trackback , No Comment
RSS :
http://www.solarview.net/rss/response/266

YouTube 동영상 내려 받기

누군가의 요청으로 꼭 유투브의 동영상을 내려받았으면 좋겠다는 요청이 있었다.

1. 구글로 검색했는데, 거의 처음 나온 사이트에서 알게된 방법이다.  YouTube 동영상을 내려받는 방법의 하나는 다음과 같다.

Vixy.net은 웹서비스로 Youtube의 페이지 주소나 Flv 링크를 직접 입력하면 해당 동영상을 다운로드 할 수 있도록 되어있다.

특이점으로는 사용자의 선택에 따라 PC용인 AVI, MOV 포맷,  PSP, iPod용 MP4 포맷, 휴대전화를 위한 3GP, 동영상에서 사운드만 추출한 MP3까지 다양한 형태의 파일을 다운로드 할 수 있다는 것.

간단한 주소 입력만으로 다운로드가 가능하다는 면에서는 이쪽이 더 우수하긴 하지만 컨버팅 작업을 웹에서 하는 탓에 동시에 많은 사용자가 몰리면 원활한 다운로드를 받을 수 없다는 단점도 존재한다.

출처 : http://www.neoearly.net/2461513
내려 받을 수는 있으나, 여전히 저작권 문제는 본인의 책임하에 있다.


2. 파이어폭스에 부가기능으로 video downloader를 설치했다. 그리고 mp4형식으로 내려 받으니 훨씬 화질이 좋았다.
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 솔라뷰

2009/08/12 17:48 2009/08/12 17:48
,
Response
No Trackback , No Comment
RSS :
http://www.solarview.net/rss/response/264

« Previous : 1 : 2 : 3 : 4 : 5 : ... 11 : Next »