Hi Folks,

 

I'm really curious.  Give at document at URI /doc.xml with two elements name
and age, is it more efficient to grab a copy of the document and then to
read the values using:

 

let $doc := doc("/doc.xml")

let $name := $doc/root/name/text() 

let $age := $doc/root/age/text()

 

or just to read the content directly:

 

let $name := doc("/doc.xml")/root/name/text() 

let $age := doc("/doc.xml")/root/age/text()

 

Why is that? Does it depend on the number of times the document is accessed?

 

Thank you!

 

Tim Meagher

 

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to