Re: [MarkLogic Dev General] Applying XSLT on XML file using xdmp:xslt-invoke

2013-07-10 Thread Geert Josten
Hi Kashif,



My first guess would be that your stylesheet returns the output as element
nodes rather than a serialized string, and document-insert assumes .html
files should be stored as text files (which is the default), and therefore
flattens the output from xml to text, effectively stripping all tags.



Depending on what you actually want to do with the stored documents, you
can try to use xsl:output to set the output method to ‘html’. That should
force the xslt to serialize the output, but xsl:output could be ignored
altogether, not sure. If that doesn’t help you can use xdmp:quote to force
serialization yourself. If you actually prefer to keep the xml structure,
just pick an extension who’s mime-type is tied to the xml format, for
instance .xhtml..



Kind regards,

Geert



*Van:* general-boun...@developer.marklogic.com [mailto:
general-boun...@developer.marklogic.com] *Namens *Khan, Kashif
*Verzonden:* woensdag 10 juli 2013 21:11
*Aan:* MarkLogic Developer Discussion
*Onderwerp:* [MarkLogic Dev General] Applying XSLT on XML file using
xdmp:xslt-invoke



Hello everyone, I am having problem understanding the following issue. Any
help will be greatly appreciated



When I use the following code in query console the XSL gets applied and I
get the proper results



let $x := xdmp:xslt-invoke("/pipelines/HTML.xsl",
doc("/ancillary/20130626114719392MXENM08AAS2X_SE_080_03.xml"))

return $x



OUTPUT

http://www.w3.org/1999/xhtml";>

  HTML Transformation

  



http://www.w3.org/2001/XMLSchema-instance"; xmlns:math="
http://www.w3.org/1998/Math/MathML"; xmlns="
http://www.imsglobal.org/xsd/imsqti_v2p1";>

http://www.harcourt.com/HSP";>





5

_



9







http://www.w3.org/2001/XMLSchema-instance"; xmlns:math="
http://www.w3.org/1998/Math/MathML"; xmlns="
http://www.imsglobal.org/xsd/imsqti_v2p1";>What is the value of the
underlined digit?

  

  5

  30

  50

  900

  







But when I try to insert the output into a document I am NOT getting the
expected results



let $x := xdmp:xslt-invoke("/pipelines/HTML.xsl",
doc("/ancillary/20130626114719392MXENM08AAS2X_SE_080_03.xml"))

return xdmp:document-insert( '/ancillary/html/transformaed.html', $x,
xdmp:default-permissions(), () )



OUTPUT:

Here is what I find  when I look at the source of transformed.html file.
There are no tags just see extracted text below.



HTML Transformation 5 _ 9 What is the value of the underlined digit?53050900







*Kashif Khan, PMI-ACP*
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Applying XSLT on XML file using xdmp:xslt-invoke

2013-07-10 Thread Khan, Kashif
Hello everyone, I am having problem understanding the following issue. Any help 
will be greatly appreciated

When I use the following code in query console the XSL gets applied and I get 
the proper results

let $x := xdmp:xslt-invoke("/pipelines/HTML.xsl", 
doc("/ancillary/20130626114719392MXENM08AAS2X_SE_080_03.xml"))
return $x

OUTPUT
http://www.w3.org/1999/xhtml";>
  HTML Transformation
  

http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1";>
http://www.harcourt.com/HSP";>


5
_

9



http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1";>What is the value of the 
underlined digit?
  
  5
  30
  50
  900
  



But when I try to insert the output into a document I am NOT getting the 
expected results

let $x := xdmp:xslt-invoke("/pipelines/HTML.xsl", 
doc("/ancillary/20130626114719392MXENM08AAS2X_SE_080_03.xml"))
return xdmp:document-insert( '/ancillary/html/transformaed.html', $x, 
xdmp:default-permissions(), () )

OUTPUT:
Here is what I find  when I look at the source of transformed.html file. There 
are no tags just see extracted text below.


HTML Transformation 5 _ 9 What is the value of the underlined digit?53050900



Kashif Khan, PMI-ACP
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MarkLogic Nagios Plugin Not Working

2013-07-10 Thread Colleen Whitney
Hi Daniel,

You're running into an issue that someone else saw very recently, and has 
suggested a work-around for.  Disclaimer that I haven't had a chance to verify 
this.  But it looks reasonable, so I"ll pass it along.  If you are still not 
succeeding with this in place, then we'll dig in further.

Replace lines 666 - 679 with the following:

# split the return into 3 based on blank line(401 header, interesting
header, body)
my @temp = (split(/^\s*$/m, $returnfromCurl, 3));

# this is the interesting header (and we skip over the earlier 401 header)
$returnfromCurl= @temp[1];

if ( $returnfromCurl =~ m/HTTP\/1.1 200/ ) {
if ( $returnfromCurl =~ m/Content-Length: 0/ ) {
$message = ("Management-API: returned: Content-Length: 0 -
$curl_command ");
}

# all is well so we now move the body of the return to the variable
$returnfromCurl = @temp[2];
$returnfromCurl =~ s/^\s+//;
}

--Colleen


From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] on behalf of Gibbons, Daniel (RBI-UK) 
[daniel.gibb...@rbi.co.uk]
Sent: Wednesday, July 10, 2013 12:40 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] MarkLogic Nagios Plugin Not Working

Hi Colleen,

I’m just coming back to the Nagios plugin now and have installed a missing lib 
that was required.  I’m now trying to test the plugin according to the 
instructions but I always receive a 404 when I execute:

[root@localhost libexec]# ./check_marklogic.pl -a admin:123 --H danspc -p 8002 
--path /manage/v1/databases --verbose 3
Input-Data:
-verbose  --> 3
-path  --> /manage/v1/databases
-authentication  --> admin:123
-port  --> 8002
-host  --> danspc
Starting Main Execution
Check-Default-parameters
-Default-parameters: specified
-Default-parameters: authentification=admin:123
-Default-parameters: host=danspc
-Default-parameters: port=8002
-Default-parameters: path=/manage/v1/databases
-checkOptionalArguments
Attention!!! Verbose should be used for debugging purposes only! (It shouldn't 
be specified when called out of Nagios)
-Optional-parameter: Verbose - specified:3
-Optional-parameter: SSL - not defined
-Optional-parameter: Key - not defined
-Optional-parameter: Timeout - not defined
-Optional-parameter: -w OR -c - not specified
ConstructCurlCommand
-Path: /manage/v1/databases
-Generated-Curl-Command: curl "http://danspc:8002/manage/v1/databases"; 
--max-time 10 --user admin:123 -i --anyauth -H "Accept: application/xml" 
--silent  2>&1
-Return-from-Curl: HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", 
nonce="33bf22c72dd890d5e19576f8c231caea", opaque="d48cc8fbaf286e51"
Content-type: text/html; charset=UTF-8
Server: MarkLogic
Content-Length: 1999
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 200 OK
Content-type: application/xml
Cache-Control: no-cache
Expires: -1
Server: MarkLogic
Content-Length: 3575
Connection: Keep-Alive
Keep-Alive: timeout=5

http://marklogic.com/manage/databases manage-databases.xsd" 
xmlns="http://marklogic.com/manage/databases"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  
/manage/v1/databases
2013-07-09T16:37:30.33+01:00
0.007
  
  
16

  /manage/v1/databases/App-Services
  8057607393266312780
  App-Services


  /manage/v1/databases/Documents
  14271765657077295025
  Documents


  /manage/v1/databases/Extensions
  7530902648671307172
  Extensions


  /manage/v1/databases/Fab
  1952001037815352
  Fab


  /manage/v1/databases/Last-Login
  6473956695837004410
  Last-Login


  /manage/v1/databases/Modules
  11869533673437169677
  Modules


  /manage/v1/databases/roxy-content
  3100704648796494438
  roxy-content


  /manage/v1/databases/roxy-content-xml
  6927599911522589565
  roxy-content-xml


  /manage/v1/databases/roxy-modules
  5470816150197939259
  roxy-modules


  /manage/v1/databases/sandbox
  7970782390963938896
  sandbox


  /manage/v1/databases/Schemas
  1613915422614640277
  Schemas


  /manage/v1/databases/Security
  6808084361331031266
  Security


  /manage/v1/databases/top-songs-admin
  15761147426355841514
  top-songs-admin


  /manage/v1/databases/top-songs-admin-modules
  16531337767321153368
  top-songs-admin-modules


  /manage/v1/databases/top-songs-admin-triggers
  1862846920905771677
  top-songs-admin-triggers


  /manage/v1/databases/Triggers
  13577706583438689626
  Triggers

  
  

  root
  default
  /manage/v1

  


Not Found (404): curl "http://danspc:8002/manage/v1/databases"; --max-time 10 
--user [username:pw] -i --anyauth -H "Accept: application/xml" --silent  2>&1
[root@localhost libexec]#


Looking at the verbose outpu

Re: [MarkLogic Dev General] java.io.IOException on store

2013-07-10 Thread Gary Larsen
Just found a relevant thread:
http://developer.marklogic.com/pipermail/general/2010-March/004924.html

 

Sorry.

Gary

 

From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gary Larsen
Sent: Wednesday, July 10, 2013 12:19 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] java.io.IOException on store

 

My java web app running in Tomcat is storing data files to the ML database
using XCCJ.  Once in a great while, apparently random,  I'll get this error.

 

This is killing a process and would like to resolve, though will probably
add a retry to see if that is successful.  Any ideas?

 

Thanks,

Gary 

 

 

com.marklogic.xcc.exceptions.ServerConnectionException: An established
connection was aborted by the software in your host machine

[Session: user=Admin, cb=NetvisnProd [ContentSource: user=Admin,
cb=NetvisnProd [provider: address=APP-EFBI-23/137.136.22.16:8023,
pool=0/64]]]

[Client: XCC/5.0-4]

at
com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(Abstrac
tRequestController.java:123)

at
com.marklogic.xcc.impl.SessionImpl.insertContent(SessionImpl.java:293)

at
com.marklogic.xcc.impl.SessionImpl.insertContent(SessionImpl.java:321)

..

 

Caused by: java.io.IOException: An established connection was aborted by the
software in your host machine

at sun.nio.ch.SocketDispatcher.write0(Native Method)

at
sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)

at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:69)

at sun.nio.ch.IOUtil.write(IOUtil.java:26)

at
sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)

at
com.marklogic.http.HttpChannel.writeBuffer(HttpChannel.java:371)

at
com.marklogic.http.HttpChannel.writeBody(HttpChannel.java:353)

at
com.marklogic.http.HttpChannel.flushRequest(HttpChannel.java:347)

at
com.marklogic.http.HttpChannel.receiveMode(HttpChannel.java:275)

at
com.marklogic.http.HttpChannel.getResponseCode(HttpChannel.java:182)

at
com.marklogic.xcc.impl.handlers.ContentInsertController.serverDialog(Content
InsertController.java:118)

at
com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(Abstrac
tRequestController.java:84)

... 14 more

 

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] java.io.IOException on store

2013-07-10 Thread Gary Larsen
My java web app running in Tomcat is storing data files to the ML database
using XCCJ.  Once in a great while, apparently random,  I'll get this error.

 

This is killing a process and would like to resolve, though will probably
add a retry to see if that is successful.  Any ideas?

 

Thanks,

Gary 

 

 

com.marklogic.xcc.exceptions.ServerConnectionException: An established
connection was aborted by the software in your host machine

[Session: user=Admin, cb=NetvisnProd [ContentSource: user=Admin,
cb=NetvisnProd [provider: address=APP-EFBI-23/137.136.22.16:8023,
pool=0/64]]]

[Client: XCC/5.0-4]

at
com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(Abstrac
tRequestController.java:123)

at
com.marklogic.xcc.impl.SessionImpl.insertContent(SessionImpl.java:293)

at
com.marklogic.xcc.impl.SessionImpl.insertContent(SessionImpl.java:321)

..

 

Caused by: java.io.IOException: An established connection was aborted by the
software in your host machine

at sun.nio.ch.SocketDispatcher.write0(Native Method)

at
sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)

at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:69)

at sun.nio.ch.IOUtil.write(IOUtil.java:26)

at
sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)

at
com.marklogic.http.HttpChannel.writeBuffer(HttpChannel.java:371)

at
com.marklogic.http.HttpChannel.writeBody(HttpChannel.java:353)

at
com.marklogic.http.HttpChannel.flushRequest(HttpChannel.java:347)

at
com.marklogic.http.HttpChannel.receiveMode(HttpChannel.java:275)

at
com.marklogic.http.HttpChannel.getResponseCode(HttpChannel.java:182)

at
com.marklogic.xcc.impl.handlers.ContentInsertController.serverDialog(Content
InsertController.java:118)

at
com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(Abstrac
tRequestController.java:84)

... 14 more

 

___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] MarkLogic Nagios Plugin Not Working

2013-07-10 Thread Gibbons, Daniel (RBI-UK)
Hi Colleen,

I'm just coming back to the Nagios plugin now and have installed a missing lib 
that was required.  I'm now trying to test the plugin according to the 
instructions but I always receive a 404 when I execute:

[root@localhost libexec]# ./check_marklogic.pl -a admin:123 --H danspc -p 8002 
--path /manage/v1/databases --verbose 3
Input-Data:
-verbose  --> 3
-path  --> /manage/v1/databases
-authentication  --> admin:123
-port  --> 8002
-host  --> danspc
Starting Main Execution
Check-Default-parameters
-Default-parameters: specified
-Default-parameters: authentification=admin:123
-Default-parameters: host=danspc
-Default-parameters: port=8002
-Default-parameters: path=/manage/v1/databases
-checkOptionalArguments
Attention!!! Verbose should be used for debugging purposes only! (It shouldn't 
be specified when called out of Nagios)
-Optional-parameter: Verbose - specified:3
-Optional-parameter: SSL - not defined
-Optional-parameter: Key - not defined
-Optional-parameter: Timeout - not defined
-Optional-parameter: -w OR -c - not specified
ConstructCurlCommand
-Path: /manage/v1/databases
-Generated-Curl-Command: curl "http://danspc:8002/manage/v1/databases"; 
--max-time 10 --user admin:123 -i --anyauth -H "Accept: application/xml" 
--silent  2>&1
-Return-from-Curl: HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", 
nonce="33bf22c72dd890d5e19576f8c231caea", opaque="d48cc8fbaf286e51"
Content-type: text/html; charset=UTF-8
Server: MarkLogic
Content-Length: 1999
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 200 OK
Content-type: application/xml
Cache-Control: no-cache
Expires: -1
Server: MarkLogic
Content-Length: 3575
Connection: Keep-Alive
Keep-Alive: timeout=5

http://marklogic.com/manage/databases manage-databases.xsd" 
xmlns="http://marklogic.com/manage/databases"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  
/manage/v1/databases
2013-07-09T16:37:30.33+01:00
0.007
  
  
16

  /manage/v1/databases/App-Services
  8057607393266312780
  App-Services


  /manage/v1/databases/Documents
  14271765657077295025
  Documents


  /manage/v1/databases/Extensions
  7530902648671307172
  Extensions


  /manage/v1/databases/Fab
  1952001037815352
  Fab


  /manage/v1/databases/Last-Login
  6473956695837004410
  Last-Login


  /manage/v1/databases/Modules
  11869533673437169677
  Modules


  /manage/v1/databases/roxy-content
  3100704648796494438
  roxy-content


  /manage/v1/databases/roxy-content-xml
  6927599911522589565
  roxy-content-xml


  /manage/v1/databases/roxy-modules
  5470816150197939259
  roxy-modules


  /manage/v1/databases/sandbox
  7970782390963938896
  sandbox


  /manage/v1/databases/Schemas
  1613915422614640277
  Schemas


  /manage/v1/databases/Security
  6808084361331031266
  Security


  /manage/v1/databases/top-songs-admin
  15761147426355841514
  top-songs-admin


  /manage/v1/databases/top-songs-admin-modules
  16531337767321153368
  top-songs-admin-modules


  /manage/v1/databases/top-songs-admin-triggers
  1862846920905771677
  top-songs-admin-triggers


  /manage/v1/databases/Triggers
  13577706583438689626
  Triggers

  
  

  root
  default
  /manage/v1

  


Not Found (404): curl "http://danspc:8002/manage/v1/databases"; --max-time 10 
--user [username:pw] -i --anyauth -H "Accept: application/xml" --silent  2>&1
[root@localhost libexec]#


Looking at the verbose output it's returning the correct XML but the plugin 
still fails, any ideas why this would happen?

Thanks

Dan



From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Colleen Whitney
Sent: 21 June 2013 16:02
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] MarkLogic Nagios Plugin Not Working

It looks like it's not finding a perl module that is available on CPAN as part 
of the Nagios::Plugin module family.

Did you successfully install all of the required libraries?  
http://docs.marklogic.com/guide/monitoring/nagios#id_62455

If you did, then the next thing to think about is whether you've got all the 
paths you need in @INC.


From: 
general-boun...@developer.marklogic.com
 [general-boun...@developer.marklogic.com] on behalf of Gibbons, Daniel 
(RBI-UK) [daniel.gibb...@rbi.co.uk]
Sent: Friday, June 21, 2013 6:49 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] MarkLogic Nagios Plugin Not Working
Hi,

I'm trying to get the Nagios plugin working in OpsView (Nagios) but after 
following the instructions in the docs I get the following:

[root@