xdmp:document-insert not creating a new file
up vote
0
down vote
favorite
I have an XML located in some directory and i want to process and write a new file in target location but its showing your query returned an empty sequence?
XML:
<xpath>
<toMultipleElement>TEXT 1.0</toMultipleElement>
<toMultipleElement>TEXT 2.0</toMultipleElement>
<toMultipleElement>TEXT 3.0</toMultipleElement>
<toMultipleElement>TEXT 4.0</toMultipleElement>
<toMultipleElement>TEXT 5.0</toMultipleElement>
<toMultipleElement>TEXT 6.0</toMultipleElement>
<toMultipleElement>TEXT 7.0</toMultipleElement>
</xpath>
xquery:
xquery version "1.0-ml";
let $input := xdmp:document-get("C:/Users/AmrendraG/Downloads/aaapp.xml")
return
xdmp:document-insert("C:/Users/AmrendraG/Downloads/aaapp-out.xml", <root>{$input}</root>)
I want to write this file as aaapp-out.xml as same location.
xquery marklogic
add a comment |
up vote
0
down vote
favorite
I have an XML located in some directory and i want to process and write a new file in target location but its showing your query returned an empty sequence?
XML:
<xpath>
<toMultipleElement>TEXT 1.0</toMultipleElement>
<toMultipleElement>TEXT 2.0</toMultipleElement>
<toMultipleElement>TEXT 3.0</toMultipleElement>
<toMultipleElement>TEXT 4.0</toMultipleElement>
<toMultipleElement>TEXT 5.0</toMultipleElement>
<toMultipleElement>TEXT 6.0</toMultipleElement>
<toMultipleElement>TEXT 7.0</toMultipleElement>
</xpath>
xquery:
xquery version "1.0-ml";
let $input := xdmp:document-get("C:/Users/AmrendraG/Downloads/aaapp.xml")
return
xdmp:document-insert("C:/Users/AmrendraG/Downloads/aaapp-out.xml", <root>{$input}</root>)
I want to write this file as aaapp-out.xml as same location.
xquery marklogic
I am new in xquery..
– Amrendra Kumar
Nov 19 at 15:08
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have an XML located in some directory and i want to process and write a new file in target location but its showing your query returned an empty sequence?
XML:
<xpath>
<toMultipleElement>TEXT 1.0</toMultipleElement>
<toMultipleElement>TEXT 2.0</toMultipleElement>
<toMultipleElement>TEXT 3.0</toMultipleElement>
<toMultipleElement>TEXT 4.0</toMultipleElement>
<toMultipleElement>TEXT 5.0</toMultipleElement>
<toMultipleElement>TEXT 6.0</toMultipleElement>
<toMultipleElement>TEXT 7.0</toMultipleElement>
</xpath>
xquery:
xquery version "1.0-ml";
let $input := xdmp:document-get("C:/Users/AmrendraG/Downloads/aaapp.xml")
return
xdmp:document-insert("C:/Users/AmrendraG/Downloads/aaapp-out.xml", <root>{$input}</root>)
I want to write this file as aaapp-out.xml as same location.
xquery marklogic
I have an XML located in some directory and i want to process and write a new file in target location but its showing your query returned an empty sequence?
XML:
<xpath>
<toMultipleElement>TEXT 1.0</toMultipleElement>
<toMultipleElement>TEXT 2.0</toMultipleElement>
<toMultipleElement>TEXT 3.0</toMultipleElement>
<toMultipleElement>TEXT 4.0</toMultipleElement>
<toMultipleElement>TEXT 5.0</toMultipleElement>
<toMultipleElement>TEXT 6.0</toMultipleElement>
<toMultipleElement>TEXT 7.0</toMultipleElement>
</xpath>
xquery:
xquery version "1.0-ml";
let $input := xdmp:document-get("C:/Users/AmrendraG/Downloads/aaapp.xml")
return
xdmp:document-insert("C:/Users/AmrendraG/Downloads/aaapp-out.xml", <root>{$input}</root>)
I want to write this file as aaapp-out.xml as same location.
xquery marklogic
xquery marklogic
asked Nov 19 at 15:06
Amrendra Kumar
9081210
9081210
I am new in xquery..
– Amrendra Kumar
Nov 19 at 15:08
add a comment |
I am new in xquery..
– Amrendra Kumar
Nov 19 at 15:08
I am new in xquery..
– Amrendra Kumar
Nov 19 at 15:08
I am new in xquery..
– Amrendra Kumar
Nov 19 at 15:08
add a comment |
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
xdmp:document-get is reading from the file system.
xdmp:document-insert is putting a document into the database.
If you want to write back to the file system, use xdmp:save.
Thanks @mholstege. I got the desired result.
– Amrendra Kumar
Nov 20 at 9:19
add a comment |
up vote
2
down vote
'xdmp:document-insert' inserts file to the database, if you want to save the file on local directory location use 'xdmp:save'.
furthermore, xdmp:document-insert will in fact return the empty sequence on success. You should now see your 'file'as a 'Document' in MarkLogic where the URI of the document is as you specified (the full path name of the file on 'disk')
– DALDEI
Nov 20 at 14:57
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
xdmp:document-get is reading from the file system.
xdmp:document-insert is putting a document into the database.
If you want to write back to the file system, use xdmp:save.
Thanks @mholstege. I got the desired result.
– Amrendra Kumar
Nov 20 at 9:19
add a comment |
up vote
5
down vote
accepted
xdmp:document-get is reading from the file system.
xdmp:document-insert is putting a document into the database.
If you want to write back to the file system, use xdmp:save.
Thanks @mholstege. I got the desired result.
– Amrendra Kumar
Nov 20 at 9:19
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
xdmp:document-get is reading from the file system.
xdmp:document-insert is putting a document into the database.
If you want to write back to the file system, use xdmp:save.
xdmp:document-get is reading from the file system.
xdmp:document-insert is putting a document into the database.
If you want to write back to the file system, use xdmp:save.
answered Nov 19 at 15:55
mholstege
3,35774
3,35774
Thanks @mholstege. I got the desired result.
– Amrendra Kumar
Nov 20 at 9:19
add a comment |
Thanks @mholstege. I got the desired result.
– Amrendra Kumar
Nov 20 at 9:19
Thanks @mholstege. I got the desired result.
– Amrendra Kumar
Nov 20 at 9:19
Thanks @mholstege. I got the desired result.
– Amrendra Kumar
Nov 20 at 9:19
add a comment |
up vote
2
down vote
'xdmp:document-insert' inserts file to the database, if you want to save the file on local directory location use 'xdmp:save'.
furthermore, xdmp:document-insert will in fact return the empty sequence on success. You should now see your 'file'as a 'Document' in MarkLogic where the URI of the document is as you specified (the full path name of the file on 'disk')
– DALDEI
Nov 20 at 14:57
add a comment |
up vote
2
down vote
'xdmp:document-insert' inserts file to the database, if you want to save the file on local directory location use 'xdmp:save'.
furthermore, xdmp:document-insert will in fact return the empty sequence on success. You should now see your 'file'as a 'Document' in MarkLogic where the URI of the document is as you specified (the full path name of the file on 'disk')
– DALDEI
Nov 20 at 14:57
add a comment |
up vote
2
down vote
up vote
2
down vote
'xdmp:document-insert' inserts file to the database, if you want to save the file on local directory location use 'xdmp:save'.
'xdmp:document-insert' inserts file to the database, if you want to save the file on local directory location use 'xdmp:save'.
answered Nov 20 at 6:26
Sunil Chouhan
485
485
furthermore, xdmp:document-insert will in fact return the empty sequence on success. You should now see your 'file'as a 'Document' in MarkLogic where the URI of the document is as you specified (the full path name of the file on 'disk')
– DALDEI
Nov 20 at 14:57
add a comment |
furthermore, xdmp:document-insert will in fact return the empty sequence on success. You should now see your 'file'as a 'Document' in MarkLogic where the URI of the document is as you specified (the full path name of the file on 'disk')
– DALDEI
Nov 20 at 14:57
furthermore, xdmp:document-insert will in fact return the empty sequence on success. You should now see your 'file'as a 'Document' in MarkLogic where the URI of the document is as you specified (the full path name of the file on 'disk')
– DALDEI
Nov 20 at 14:57
furthermore, xdmp:document-insert will in fact return the empty sequence on success. You should now see your 'file'as a 'Document' in MarkLogic where the URI of the document is as you specified (the full path name of the file on 'disk')
– DALDEI
Nov 20 at 14:57
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377446%2fxdmpdocument-insert-not-creating-a-new-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I am new in xquery..
– Amrendra Kumar
Nov 19 at 15:08