Programming/node.js2019. 8. 8. 11:04

이것저것 테스트 하다가 가장 무난한게 select1 인것 같고

검색이 되지 않으면 탭이나 콤마를

검색이 되었으나 값의 저장위치에 따라 value와 firstChild.data로 저장이 된다.

firstChild.data는 element 자체의 내용(content라고 해야하나 머라고 해야하나?)이 저장되는 장소이다.

 

var result_attr = xpath.select1(ele, doc);
                    // var result_ele = xpath.select(ele, doc);

                    if (result_attr != undefined) {
                        if (result_attr.value != undefined) {
                            // record += (result_attr.firstChild + delimiter)
                            record += ('"' + result_attr.value + '"' + delimiter)
                            // console.log(result_attr.value);
                        }
                        else {
                            record += ('"' + result_attr.firstChild.data + '"' + delimiter)
                            // console.log(result_attr.firstChild.data);
                        }
                    }
                    else {
                        record += delimiter;
                    }

 

 

 

'Programming > node.js' 카테고리의 다른 글

node.js csv2json  (0) 2019.08.21
node.js regex  (0) 2019.08.12
xpath text()  (0) 2019.08.07
node.js readline과 r/w stream  (0) 2019.07.31
node.js xpath select() select1()  (0) 2019.07.25
Posted by 구차니
Programming/xml2019. 8. 8. 11:02

특정 위치중에 attribute가 DB이고 값이 Gene일 경우 해당 Xref element의 ID attribute의 값을 받는 예제

(말이 어렵다 -ㅁ-)

 

/ClinVarSet/ReferenceClinVarAssertion/MeasureSet/Measure/MeasureRelationship/XRef[@DB='Gene']/@ID

[링크 : https://www.w3schools.com/xml/xpath_syntax.asp]

'Programming > xml' 카테고리의 다른 글

xpath xsi  (0) 2019.08.12
xpath concat  (0) 2019.08.08
xpath..  (0) 2019.08.01
xmllint string()  (0) 2019.07.25
libxml2 - xmlNodeDump()  (0) 2019.07.09
Posted by 구차니
Programming/android2019. 8. 8. 09:35

failed to find target with hash string 'android-27'

요런 에러가 발생하면 구버전 SDK를 쓰고 있는데 현재 시스템에 해당 버전의 SDK가 없어서 발생하는 에러라고 한다.

[링크 : https://elecs.tistory.com/157]

 

File-Settings - Appearance - System Setting - Android SDK 에서 에러에 맞는 SDK를 설치후 리빌드

[링크 : https://hunit.tistory.com/365]

 

error: resource android:attr/dialogCornerRadius not found.

[링크 : https://blog.soobinpark.com/149]

 

이건 도움을 별로 못 받았고

버전을 보니 0.7.6이 현재 깨져서 받지 못하게 된 상태라 0.7.5로 일단 변경해서 빌드는 완료

[링크 : https://jitpack.io/#mancj/MaterialSearchBar]

Posted by 구차니
Programming/node.js2019. 8. 7. 23:15

<element>text</element>

에서 text만 꺼내주는 함수(?)

'Programming > node.js' 카테고리의 다른 글

node.js regex  (0) 2019.08.12
node.js xpath 모듈  (0) 2019.08.08
node.js readline과 r/w stream  (0) 2019.07.31
node.js xpath select() select1()  (0) 2019.07.25
node.js xpath apidoc  (0) 2019.07.25
Posted by 구차니
Programming/web 관련2019. 8. 7. 10:43

맨날 json beautifier 찾아서 온라인으로 했는데

오프라인으로 바로 처리되니 편하네

 

[링크 : https://chrome.google.com/webstore/search/json%20view?hl=ko]

'Programming > web 관련' 카테고리의 다른 글

web gl on chrome  (0) 2021.12.14
markdown 문법 - 체크박스  (0) 2020.10.15
resizable table cell  (0) 2019.06.17
web framework  (0) 2019.06.05
ECDHE?  (0) 2019.04.26
Posted by 구차니
Programming/xml2019. 8. 1. 15:03

node.js 에서 원하는 갯수를 확인하려면

.length를 통해 array의 갯수를 확인하면 되긴한다.

 

MeasureSet 의 갯수를 확인하고

> var result_ele = xpath.select("/ClinVarSet/ReferenceClinVarAssertion/GenotypeSet/MeasureSet", doc);
undefined
result_ele.length
2

 

MeasureSet의 인덱스로 접근해서 몇개씩을 가지는지 확인하면 될 듯

> var result_ele = xpath.select("/ClinVarSet/ReferenceClinVarAssertion/GenotypeSet/MeasureSet[1]/Measure/AttributeSet/Attribute", doc);
undefined
result_ele.length
9
> var result_ele = xpath.select("/ClinVarSet/ReferenceClinVarAssertion/GenotypeSet/MeasureSet[2]/Measure/AttributeSet/Attribute", doc);
undefined
result_ele.length
7

 

[링크 : https://stackoverflow.com/questions/2407781/get-nth-child-of-a-node-using-xpath]

'Programming > xml' 카테고리의 다른 글

xpath concat  (0) 2019.08.08
xpath syntax - attribute 검색 및 특정값 얻기  (0) 2019.08.08
xmllint string()  (0) 2019.07.25
libxml2 - xmlNodeDump()  (0) 2019.07.09
libxml2  (0) 2019.07.04
Posted by 구차니
Programming/node.js2019. 7. 31. 18:12

일단은.. 8기가 짜리 파일을 잘 토막쳐서 읽고 있다.

예전에는 멀 잘못했는지 오래걸리기도 했고, 조금 읽다 보면 버버버버벅했는데

스트림으로 변경하고 나니 속도 저하도 없고

메모리 사용율 문제나 크래시도 발생하지 않고 있다.

 

다만.. readline 모듈의 경우 output을 process.stdout으로 해주면 프롬프트랑 섞이면서 난리나고

output을 다른 파일로 연결을 하는법을 아직 찾지 못해 헤매는 중..

(그냥 다른 파일로 직접 쓰는 중)

'Programming > node.js' 카테고리의 다른 글

node.js xpath 모듈  (0) 2019.08.08
xpath text()  (0) 2019.08.07
node.js xpath select() select1()  (0) 2019.07.25
node.js xpath apidoc  (0) 2019.07.25
node.js readline()  (0) 2019.06.28
Posted by 구차니
Programming/node.js2019. 7. 25. 14:41

select1()은 attribute 빼낼때 .value로 쓸수 있고

select()는 element 단위로 빼낼때 쓰는 듯

 

xpath 에서 attribute 빼내려면

/Ele@Attr이 아니라

/Ele/@Attr로 해야지 정상적으로 인식한다.

'Programming > node.js' 카테고리의 다른 글

xpath text()  (0) 2019.08.07
node.js readline과 r/w stream  (0) 2019.07.31
node.js xpath apidoc  (0) 2019.07.25
node.js readline()  (0) 2019.06.28
node.js 메모리 사용 가능 용량 늘리기  (0) 2019.06.21
Posted by 구차니
Programming/node.js2019. 7. 25. 13:32

'Programming > node.js' 카테고리의 다른 글

node.js readline과 r/w stream  (0) 2019.07.31
node.js xpath select() select1()  (0) 2019.07.25
node.js readline()  (0) 2019.06.28
node.js 메모리 사용 가능 용량 늘리기  (0) 2019.06.21
node.js fs.createreadstream highWaterMark  (0) 2019.06.19
Posted by 구차니
Programming/xml2019. 7. 25. 12:45

-xpath "@Version" 으로 하면 값과 Atrribute 이름이 같이 출력되는데

Version="" 식으로

 

"string(@Version)" 으로 하면 "" 안의 값만 출력된다.

 

[링크 : https://unix.stackexchange.com/questions/219373/]

'Programming > xml' 카테고리의 다른 글

xpath syntax - attribute 검색 및 특정값 얻기  (0) 2019.08.08
xpath..  (0) 2019.08.01
libxml2 - xmlNodeDump()  (0) 2019.07.09
libxml2  (0) 2019.07.04
xmlstarlet  (0) 2016.05.26
Posted by 구차니