Programming/xml2019. 8. 12. 15:42

xml namespace나 schema 관련된 녀석을 조회하려는데

어떻게 해야 할지 감이 안와서(evaluation fail막 뜨고..) 찾다가 발견

name이 아니라 name()이 포인트

//*[name()='xsi:noNamespaceSchemaLocation']

 

[링크 : https://stackoverflow.com/questions/4817112/xpath-query-for-xml-node-with-colon-in-node-name]

 

xsi는 Xml Schema Instance의 약자인 것으로 보인다.

인스턴스 문서가 참조할 때는 두 가지 특별한 애트리뷰트를 사용하는데, xsi:schemaLocation xsi:noNamespaceSchemaLocation이 그것이다. 관습적으로 "xsi"는 "http://www.w3.org/2001/XMLSchema-instance"를 가리키는 접두어로 쓰인다.)

[링크 : https://ko.wikipedia.org/wiki/XML_스키마_(W3C)]

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

xsd minOccurs, maxOccurs  (0) 2019.09.11
xpath count()  (0) 2019.09.09
xpath concat  (0) 2019.08.08
xpath syntax - attribute 검색 및 특정값 얻기  (0) 2019.08.08
xpath..  (0) 2019.08.01
Posted by 구차니
Programming/xml2019. 8. 8. 11:09

음.. 시도해보고 수정필요

해당 항목을 검색해서 그 결과를 붙여주는건 아니라 실망..

 

[링크 : https://stackoverflow.com/questions/21996965/concatenate-multiple-node-values-in-xpath]

[링크 : https://stackoverflow.com/questions/3398871/concatenate-multiple-attribute-values]

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

xpath count()  (0) 2019.09.09
xpath xsi  (0) 2019.08.12
xpath syntax - attribute 검색 및 특정값 얻기  (0) 2019.08.08
xpath..  (0) 2019.08.01
xmllint string()  (0) 2019.07.25
Posted by 구차니
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 관련' 카테고리의 다른 글

grid와 flex  (0) 2022.07.04
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 구차니