Thanks Indrajeet Verma. I did not realize that using "//" will remove my 
problem.

I was looking for this only, "fn:exists($x//text()[fn:normalize-space(.) ne 
""])"

Thanks 
Rahul

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of 
[email protected]
Sent: Thursday, April 9, 2015 3:55 PM
To: [email protected]
Subject: General Digest, Vol 130, Issue 25

Send General mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://developer.marklogic.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific than "Re: 
Contents of General digest..."


Today's Topics:

   1. Re: text() Vs String() Vs data() (Indrajeet Verma)
   2. Re: text() Vs String() Vs data() (Indrajeet Verma)
   3. Re: MLCP - copy database from localhost to virtual server
      (Andreas Hubmer)


----------------------------------------------------------------------

Message: 1
Date: Thu, 9 Apr 2015 13:17:46 +0530
From: Indrajeet Verma <[email protected]>
Subject: Re: [MarkLogic Dev General] text() Vs String() Vs data()
To: MarkLogic Developer Discussion <[email protected]>
Message-ID:
        <CAKwHAejDkM8wck=2KNuarMisw02HoqSJHPN1QNYYGDu=w0y...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Rahul - I am not completely sure on your question however could you try below 
code and see if this helps,

let $x :=
<head xmlns="http://www.w3.org/1999/xhtml";>
    <script type="text/javascript"></script>
    <title></title>
</head>
return $x//text()[fn:normalize-space(.) ne '']



On Thu, Apr 9, 2015 at 1:05 PM, Asitmohan Nautiyal <[email protected]>
wrote:

>  Hi Rahul,
>
>
>
> Please refer below link for your clarification written by David log 
> back ago :
>
>
>
> http://blog.davidcassel.net/2011/06/text-fnstring-and-fndata/
>
>
>
>
>
> Regards,
>
> Asit Nautiyal
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Rahul Gupta
> *Sent:* 09 April 2015 12:41
> *To:* [email protected]
> *Subject:* [MarkLogic Dev General] text() Vs String() Vs data()
>
>
>
> I have come across a problem. I want to check here whether the given 
> xml contains any kind of text. I don?t want any output if any of the 
> children doesn?t have any text. Like in the example given, it should 
> not give me anything.
>
> let $x :=
>
> <head xmlns="http://www.w3.org/1999/xhtml";>
>
>     <script type="text/javascript"></script>
>
>     <title></title>
>
> </head>
>
> (1) $x/text() will yield nothing. But if I change Hi David, then also 
> it is returning nothing since text() works on the self-node. That?s fine.
>
> (2) $x/string() will yield something but dont know what? I was 
> expecting it should not give me anything in the example mentioned. Can 
> you please help?
>
> (3) $x/data gives ?XDMP-NONMIXEDCOMPLEXCONT: Node has complex type 
> with non-mixed complex content.? since the head node is under some 
> namespace {WHY??}. Removing the namespace solves this error but 
> behaving same like string.
>
>
>
> Thanks & Regards,
>
> Rahul
>
>
>
> ::DISCLAIMER::
>
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> --------
>
> The contents of this e-mail and any attachment(s) are confidential and 
> intended for the named recipient(s) only.
> E-mail transmission is not guaranteed to be secure or error-free as 
> information could be intercepted, corrupted, lost, destroyed, arrive 
> late or incomplete, or may contain viruses in transmission. The e mail 
> and its contents (with or without referred errors) shall therefore not 
> attach any liability on the originator or HCL or its affiliates.
> Views or opinions, if any, presented in this email are solely those of 
> the author and may not necessarily reflect the views or opinions of 
> HCL or its affiliates. Any form of reproduction, dissemination, 
> copying, disclosure, modification, distribution and / or publication 
> of this message without the prior written consent of authorized 
> representative of HCL is strictly prohibited. If you have received 
> this email in error please delete it and notify the sender 
> immediately.
> Before opening any email and/or attachments, please check them for 
> viruses and other defects.
>
>
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> --------
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://developer.marklogic.com/pipermail/general/attachments/20150409/275e8d61/attachment-0001.html
 

------------------------------

Message: 2
Date: Thu, 9 Apr 2015 13:45:39 +0530
From: Indrajeet Verma <[email protected]>
Subject: Re: [MarkLogic Dev General] text() Vs String() Vs data()
To: MarkLogic Developer Discussion <[email protected]>
Message-ID:
        <cakwhaej3j0tmrw5boxyjagbjq57uwv6t1woluuujgpyqopz...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I used $x//text() in place of $x/text()  as it try to get text from a direct 
child of the context element. i.e. head. that is the reason you are not seeing 
any result.

If you add any text inside <head> then your $x/text() will return the result.

If you have to check the text present in any level, you need to use //.

Use data and string like below,

Please correct somebody if I am wrong here.

let $x :=
<head xmlns="http://www.w3.org/1999/xhtml";>
    <script type="text/javascript"></script>
    <title> </title>
</head>
return data($x/node()[fn:normalize-space(.) ne ''])


let $x :=
<head xmlns="http://www.w3.org/1999/xhtml";>
    <script type="text/javascript"></script>
    <title> </title>
</head>
return string($x/node()[fn:normalize-space(.) ne ''])

Please note, performance will be poor in these cases

Please don't use $x//string() or $x//data(), It will give you multiple results 
based on element hierarchy.

On Thu, Apr 9, 2015 at 1:17 PM, Indrajeet Verma <[email protected]>
wrote:

> Rahul - I am not completely sure on your question however could you 
> try below code and see if this helps,
>
> let $x :=
> <head xmlns="http://www.w3.org/1999/xhtml";>
>     <script type="text/javascript"></script>
>     <title></title>
> </head>
> return $x//text()[fn:normalize-space(.) ne '']
>
>
>
> On Thu, Apr 9, 2015 at 1:05 PM, Asitmohan Nautiyal 
> <[email protected]>
> wrote:
>
>>  Hi Rahul,
>>
>>
>>
>> Please refer below link for your clarification written by David log 
>> back ago :
>>
>>
>>
>> http://blog.davidcassel.net/2011/06/text-fnstring-and-fndata/
>>
>>
>>
>>
>>
>> Regards,
>>
>> Asit Nautiyal
>>
>> *From:* [email protected] [mailto:
>> [email protected]] *On Behalf Of *Rahul Gupta
>> *Sent:* 09 April 2015 12:41
>> *To:* [email protected]
>> *Subject:* [MarkLogic Dev General] text() Vs String() Vs data()
>>
>>
>>
>> I have come across a problem. I want to check here whether the given 
>> xml contains any kind of text. I don?t want any output if any of the 
>> children doesn?t have any text. Like in the example given, it should 
>> not give me anything.
>>
>> let $x :=
>>
>> <head xmlns="http://www.w3.org/1999/xhtml";>
>>
>>     <script type="text/javascript"></script>
>>
>>     <title></title>
>>
>> </head>
>>
>> (1) $x/text() will yield nothing. But if I change Hi David, then also 
>> it is returning nothing since text() works on the self-node. That?s fine.
>>
>> (2) $x/string() will yield something but dont know what? I was 
>> expecting it should not give me anything in the example mentioned. 
>> Can you please help?
>>
>> (3) $x/data gives ?XDMP-NONMIXEDCOMPLEXCONT: Node has complex type 
>> with non-mixed complex content.? since the head node is under some 
>> namespace {WHY??}. Removing the namespace solves this error but 
>> behaving same like string.
>>
>>
>>
>> Thanks & Regards,
>>
>> Rahul
>>
>>
>>
>> ::DISCLAIMER::
>>
>> ---------------------------------------------------------------------
>> ---------------------------------------------------------------------
>> ----------
>>
>> The contents of this e-mail and any attachment(s) are confidential 
>> and intended for the named recipient(s) only.
>> E-mail transmission is not guaranteed to be secure or error-free as 
>> information could be intercepted, corrupted, lost, destroyed, arrive 
>> late or incomplete, or may contain viruses in transmission. The e 
>> mail and its contents (with or without referred errors) shall 
>> therefore not attach any liability on the originator or HCL or its 
>> affiliates.
>> Views or opinions, if any, presented in this email are solely those 
>> of the author and may not necessarily reflect the views or opinions 
>> of HCL or its affiliates. Any form of reproduction, dissemination, 
>> copying, disclosure, modification, distribution and / or publication 
>> of this message without the prior written consent of authorized 
>> representative of HCL is strictly prohibited. If you have received 
>> this email in error please delete it and notify the sender 
>> immediately.
>> Before opening any email and/or attachments, please check them for 
>> viruses and other defects.
>>
>>
>> ---------------------------------------------------------------------
>> ---------------------------------------------------------------------
>> ----------
>>
>> _______________________________________________
>> General mailing list
>> [email protected]
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://developer.marklogic.com/pipermail/general/attachments/20150409/c2c51162/attachment-0001.html
 

------------------------------

Message: 3
Date: Thu, 9 Apr 2015 12:25:06 +0200
From: Andreas Hubmer <[email protected]>
Subject: Re: [MarkLogic Dev General] MLCP - copy database from
        localhost to virtual server
To: MarkLogic Developer Discussion <[email protected]>
Message-ID:
        <CAJxWhKsqCnKAaFy_STYr_LzaWaEv9nWnhN=oknha3au6pqv...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Thanks. Is there a way for me to get notified when the bug is fixed?

2015-04-08 18:01 GMT+02:00 David Lee <[email protected]>:

>  Thanks,  I have tracked this down and will be opening a bug.
>
> It affects mlcp but not xcc.
>
>
>
> The workaround for now is to make sure that your server's defined 
> hostname is resolvable from the client as the same hostname.
>
>
>
>
>
>
> ----------------------------------------------------------------------
> -------
>
> David Lee
> Lead Engineer
> *Mark**Logic* Corporation
> [email protected]
> Phone: +1 812-482-5224
>
> Cell:  +1 812-630-7622
> www.marklogic.com
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Andreas Hubmer
> *Sent:* Wednesday, April 08, 2015 9:51 AM
>
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] MLCP - copy database from 
> localhost to virtual server
>
>
>
> Here is my command line call (using mlcp-Hadoop2-1.3-1):
>
> *mlcp.bat export -host 10.100.0.101 -port 8007 -username USR -password 
> *
>
> *PW -output_file_path export-test *
>
>
>
> Standard-Output:
>
> 15/03/24 11:44:56 INFO contentpump.ContentPump: Hadoop library version:
>
> 2.0.0-alpha
>
> 15/03/24 11:44:56 WARN util.KerberosName: Kerberos krb5 configuration 
> not
>
> found, setting default realm to empty
>
> 15/03/24 11:44:56 INFO mapreduce.MarkLogicInputFormat: 1 forest splits.
>
> 15/03/24 11:44:56 INFO mapreduce.MarkLogicInputFormat: Made 1 splits.
>
> 15/03/24 11:44:57 ERROR contentpump.LocalJobRunner: Error running task:
>
> java.lang.IllegalArgumentException: Default provider - Not a usable 
> net
>
> address: *foohost*:8007
>
>         at
>
>
> com.marklogic.xcc.ContentSourceFactory.defaultConnectionProvider(Conte
> ntSourceFactory.java:331)
>
>         at
>
>
> com.marklogic.xcc.ContentSourceFactory.newContentSource(ContentSourceF
> actory.java:219)
>
>         at
>
>
> com.marklogic.xcc.ContentSourceFactory.newContentSource(ContentSourceF
> actory.java:243)
>
>         at
>
>
> com.marklogic.mapreduce.utilities.InternalUtilities.getInputContentSou
> rce(InternalUtilities.java:144)
>
>         at
>
>
> com.marklogic.mapreduce.MarkLogicRecordReader.initialize(MarkLogicReco
> rdReader.java:192)
>
>         at
>
>
> com.marklogic.contentpump.LocalJobRunner$TrackingRecordReader.initiali
> ze(LocalJobRunner.java:430)
>
>         at
>
>
> com.marklogic.contentpump.LocalJobRunner$LocalMapTask.call(LocalJobRun
> ner.java:371)
>
>         at java.util.concurrent.FutureTask.run(Unknown Source)
>
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source)
>
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>
> Source)
>
>         at java.lang.Thread.run(Unknown Source)
>
> 15/03/24 11:44:57 INFO contentpump.LocalJobRunner: completed 0%
>
> 15/03/24 11:44:57 INFO contentpump.LocalJobRunner: Total execution 
> time: 0
>
> sec
>
>
>
> In my workaround I added 10.100.0.101 with its hostname (*foohost*) to 
> my local hostname file.
>
>
>
> The remote server is a single machine, not a cluster.
>
>
>
> It could be a regression bug from ML7 to ML8. The same MLCP call to 
> our
> ML7 server worked. But I cannot completely exclude configuration 
> differences between the two servers.
>
>
>
> 2015-04-08 15:14 GMT+02:00 David Lee <[email protected]>:
>
>   What flags were you passing to mlcp ?
>
> If its a 'simple' default connection with basic authentication I 
> believe that the DNS shouldn't mater,
>
> if it does I'll see if I can reproduce and file a bug if needed.
>
>
>
> If its a more complex connection, such as direct forest placement, 
> HDFS, going through a load balencer etc then it may make a difference.
>
>
>
> As much specifics of your server config, mlcp config and network 
> topology would help.
>
>
>
>
>
>
> ----------------------------------------------------------------------
> -------
>
> David Lee
> Lead Engineer
> *Mark**Logic* Corporation
> [email protected]
> Phone: +1 812-482-5224
>
> Cell:  +1 812-630-7622
> www.marklogic.com
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Andreas Hubmer
> *Sent:* Wednesday, April 08, 2015 3:26 AM
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] MLCP - copy database from 
> localhost to virtual server
>
>
>
> Hi,
>
>
>
> I had a similar problem with the error "not a useable net address". 
> The root cause seemed to be that MLCP does not work well when you use 
> the ip address of the remote database and the hostname of the remote 
> server is not in your DNS. This is strange because I don't see a 
> reason why MLCP should need the hostname when I use the ip address.
>
>
>
> My workaround is to add the the hostname of the remote server to my 
> local hostname file.
>
>
>
> Regards,
>
> Andreas
>
>
>
>
>
>
>
>
>
>
>
> 2015-04-07 17:22 GMT+02:00 Frank Mortier <[email protected]>:
>
>   I forgot to add :
>
>
>
> Windows 8
>
> ML 8.0-1.1
>
> JRE1.8.0-40 and/or JDK 1.8.0-40
>
>
>
>
>
> *From:* Frank Mortier
> *Sent:* 07 April 2015 17:07
> *To:* MarkLogic Developer Discussion
> *Subject:* MLCP - copy database from localhost to virtual server
>
>
>
> Hi there,
>
>
>
> I would like to copy a database from a local ml server to a ml server 
> located on an azure virtual machine. I however get the warning and 
> error listed in the screenshot (Kerberos configuration not found and 
> not a useable net address). Any suggestion?
>
>
>
> I have also tried to export the database to an archive but it only 
> copies part of  the documents in the database!
>
>
>
> Thanks for the suggestions.
>
>
>
> Frank
>
>
>
>
>
>
>
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
>
>
> --
>
> Andreas Hubmer
>
> IT Consultant
>
>
>
> EBCONT enterprise technologies GmbH
>
> Millennium Tower
>
> Handelskai 94-96
>
> A-1200 Vienna
>
>
>
> Mobile: +43 664 60651861
>
> Fax: +43 2772 512 69-9
>
> Email: [email protected]
>
> Web: http://www.ebcont.com
>
>
>
> OUR TEAM IS YOUR SUCCESS
>
>
>
> UID-Nr. ATU68135644
>
> HG St.P?lten - FN 399978 d
>
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
>
>
> --
>
> Andreas Hubmer
>
> IT Consultant
>
>
>
> EBCONT enterprise technologies GmbH
>
> Millennium Tower
>
> Handelskai 94-96
>
> A-1200 Vienna
>
>
>
> Mobile: +43 664 60651861
>
> Fax: +43 2772 512 69-9
>
> Email: [email protected]
>
> Web: http://www.ebcont.com
>
>
>
> OUR TEAM IS YOUR SUCCESS
>
>
>
> UID-Nr. ATU68135644
>
> HG St.P?lten - FN 399978 d
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>


--
Andreas Hubmer
IT Consultant

EBCONT enterprise technologies GmbH
Millennium Tower
Handelskai 94-96
A-1200 Vienna

Mobile: +43 664 60651861
Fax: +43 2772 512 69-9
Email: [email protected]
Web: http://www.ebcont.com

OUR TEAM IS YOUR SUCCESS

UID-Nr. ATU68135644
HG St.P?lten - FN 399978 d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://developer.marklogic.com/pipermail/general/attachments/20150409/231ce2d6/attachment.html
 

------------------------------

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


End of General Digest, Vol 130, Issue 25
****************************************
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to