xquery

Write directly to file from BaseX GUI

孤街醉人 提交于 2020-08-04 17:18:36
问题 I wrote an XQuery expression that has a large result of about 50MB and takes a couple of hours to compute. I execute it in the BaseX GUI, but this is a little inconvenient: it crops the result to a result window, which I then have to save. At this time, BaseX becomes unresponsive and may crash. Is there a way to directly write the result to a file? 回答1: Have a look at BaseX' file module, which provides broad functionality to read and write from files and traverse the file system. For you,

Write directly to file from BaseX GUI

折月煮酒 提交于 2020-08-04 17:15:48
问题 I wrote an XQuery expression that has a large result of about 50MB and takes a couple of hours to compute. I execute it in the BaseX GUI, but this is a little inconvenient: it crops the result to a result window, which I then have to save. At this time, BaseX becomes unresponsive and may crash. Is there a way to directly write the result to a file? 回答1: Have a look at BaseX' file module, which provides broad functionality to read and write from files and traverse the file system. For you,

Write directly to file from BaseX GUI

北城余情 提交于 2020-08-04 17:15:02
问题 I wrote an XQuery expression that has a large result of about 50MB and takes a couple of hours to compute. I execute it in the BaseX GUI, but this is a little inconvenient: it crops the result to a result window, which I then have to save. At this time, BaseX becomes unresponsive and may crash. Is there a way to directly write the result to a file? 回答1: Have a look at BaseX' file module, which provides broad functionality to read and write from files and traverse the file system. For you,

python3爬虫之xpath

痞子三分冷 提交于 2020-08-04 16:51:34
一、简介   XPath 是一门在 XML 文档中查找信息的语言。XPath 可用来在 XML 文档中对元素和属性进行遍历。XPath 是 W3C XSLT 标准的主要元素,并且 XQuery 和 XPointer 都构建于 XPath 表达之上。 二、安装 pip3 install lxml 三、使用 选取节点 常用的路径表达式 nodename(表达式、) 选取nodename节点的所有子节点 (描述) xpath(‘//div’) 选取了div节点的所有子节点(实例) / 从根节点选取 xpath(‘/div’) 从根节点上选取div节点 // 选取所有的当前节点,不考虑他们的位置 xpath(‘//div’) 选取所有的div节点 . 选取当前节点 xpath(‘./div’) 选取当前节点下的div节点 .. 选取当前节点的父节点 xpath(‘..’) 回到上一个节点 @ 选取属性 xpath(’//@calss’)选取所有的class属性 谓词:被嵌在方括号内,用来查找某个特定的节点或包含某个制定的值的节点 xpath(‘/body/div[1]’)   选取body下的第一个div节点 xpath(‘/body/div[last()]’)   选取body下最后一个div节点 xpath(‘/body/div[last()-1]’)  

XSLT doc(uri) or document(uri) function not resolving uri in context of content database?

两盒软妹~` 提交于 2020-07-22 22:15:17
问题 Working with latest MarkLogic-10.0-2.1-amd64 on win10 In a xquery I invoke an xslt transformation: xdmp:xslt-invoke("/tidy2html.xslt", doc($docurl)) And within that xslt transformation, I want to retrieve an additional doc (with uri sdp/xref.xml) from the content database where $docurl resides. <xsl:variable name="xref-uri" select="doc('sdp/xref.xml')"/> I'm sure by looking at query console that doc('sdp/xref.xml') exists using XQuery context pointed to the content database. In XSLT I'm a bit

XSLT doc(uri) or document(uri) function not resolving uri in context of content database?

冷暖自知 提交于 2020-07-22 22:13:37
问题 Working with latest MarkLogic-10.0-2.1-amd64 on win10 In a xquery I invoke an xslt transformation: xdmp:xslt-invoke("/tidy2html.xslt", doc($docurl)) And within that xslt transformation, I want to retrieve an additional doc (with uri sdp/xref.xml) from the content database where $docurl resides. <xsl:variable name="xref-uri" select="doc('sdp/xref.xml')"/> I'm sure by looking at query console that doc('sdp/xref.xml') exists using XQuery context pointed to the content database. In XSLT I'm a bit

XSLT doc(uri) or document(uri) function not resolving uri in context of content database?

你说的曾经没有我的故事 提交于 2020-07-22 22:12:37
问题 Working with latest MarkLogic-10.0-2.1-amd64 on win10 In a xquery I invoke an xslt transformation: xdmp:xslt-invoke("/tidy2html.xslt", doc($docurl)) And within that xslt transformation, I want to retrieve an additional doc (with uri sdp/xref.xml) from the content database where $docurl resides. <xsl:variable name="xref-uri" select="doc('sdp/xref.xml')"/> I'm sure by looking at query console that doc('sdp/xref.xml') exists using XQuery context pointed to the content database. In XSLT I'm a bit

How do I use RESTXQ with BaseX for a simple web app?

耗尽温柔 提交于 2020-07-22 12:19:12
问题 I'm trying to create a really basic web app that lets a user upload an xml file with a form, runs an XQuery script which I already have written as a function, and returns the result. I have BaseX running on Tomcat, but for the life of my I cannot understand RESTXQ even though I have a lot of experience with complex XQuery scripts. The BaseX documentation has been no help (http://docs.basex.org/wiki/RESTXQ). What is the basic architecture? From what I can see, its all keyed on this restxq.xqm

How do I use RESTXQ with BaseX for a simple web app?

Deadly 提交于 2020-07-22 12:19:12
问题 I'm trying to create a really basic web app that lets a user upload an xml file with a form, runs an XQuery script which I already have written as a function, and returns the result. I have BaseX running on Tomcat, but for the life of my I cannot understand RESTXQ even though I have a lot of experience with complex XQuery scripts. The BaseX documentation has been no help (http://docs.basex.org/wiki/RESTXQ). What is the basic architecture? From what I can see, its all keyed on this restxq.xqm

removing an element from xml using saxon xquery

懵懂的女人 提交于 2020-07-22 04:26:09
问题 Hi I have an xml like this: <ns1:books><ns2:book category="WEB"><ns3:title lang="en">Learning XML</ns3:title> <ns3:author>Erik T. Ray</ns3:author><ns3:year>2003</ns3:year><ns3:price>39.95</price> Using Saxon xquery I want to remove the ns3:author element, could anyone let me know how can I do it ? I know there is a fn:remove(..) method but I don't want to use that as it takes an integer as a 2nd argument Any complete code will be much appreciated Also with saxon I am facing the error like