Xquery의 data() 함수와 string() 함수의 실제 차이점은 무엇입니까? 그들이 그것을 사용할 때 둘 다 같은 결과를 반환하는 것 같습니다. 다른 사람이 어떻게 다른지에 대한 간단한 예를 들어 줄 수 있습니까? data()
은 "입력 값"을 반환하는 반면data()와 string()의 차이점
let $dataset :=
<data-set cool="rad">
<!--- This is a comment -->
<pages cool2="rad2" more="i guess">
<page>
<title>Puppy</title>
<content>Puppies are great!</content>
</page>
<page>
<title>Dogs</title>
<content>Dogs are grown up!</content>
</page>
<page>
<title>Puppy</title>
<content>Puppies are great!</content>
</page>
</pages>
</data-set>
return $dataset/string()
(: data() returns the same thing as string() :)
(: return $dataset/data() :)
이 토론 - http://developer.marklogic.com/blog/text-is-a-code-smell#comment-407618423도 참조하십시오. 전체 기사는 text()에 대해 확실하지 않은 경우 유용합니다. – joewiz