Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4618684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:18:07+00:00 2026-05-22T02:18:07+00:00

we have a DITA XML application that produces on the fly xhtml and when

  • 0

we have a DITA XML application that produces on the fly xhtml and when viewed in the browser it looks fine.

An example url is: http://livecontent.jordanpublishing.co.uk/content/en/FAMILY-201103311115/Family_FLJONLINE_FLJ_2009_07_4

Scrrenshot of our application

If I try to load the url using curl I get the following error:

Error checking function parameter 3 in call transform:transform($fDoc, LiveContent-UI:get_xsl("ui/ui_skin.xsl", ""), LiveContent-UI:get_xsl_params(untyped-value-check[xs:string, $skin], $extra_params)): The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: LiveContent-Util:browser_from_user_agent($a as xs:string) xs:string. Expected cardinality: exactly one, got 0.

XQuery Stack TraceLiveContent-Util:browser_from_user_agent(xs:string)   161:55
LiveContent-UI:get_xsl_params(xs:string, node())    145:25
LiveContent-UI:get_html(xs:string, xs:string, node(), node())   313:25
LiveContent-Pub:home(xs:string, xs:string, xs:string)   65:17
Java Stack Trace:Class Name Method Name File Name   Line
org.exist.xquery.DynamicCardinalityCheck    eval    DynamicCardinalityCheck.java    80
org.exist.xquery.Atomize    eval    Atomize.java    66
org.exist.xquery.UntypedValueCheck  eval    UntypedValueCheck.java  75
org.exist.xquery.DynamicTypeCheck   eval    DynamicTypeCheck.java   61
org.exist.xquery.FunctionCall   eval    FunctionCall.java   185
org.exist.xquery.AbstractExpression eval    AbstractExpression.java 61
org.exist.xquery.PathExpr   eval    PathExpr.java   241
org.exist.xquery.AttributeConstructor   eval    AttributeConstructor.java   95
org.exist.xquery.ElementConstructor eval    ElementConstructor.java 212
org.exist.xquery.AbstractExpression eval    AbstractExpression.java 61
org.exist.xquery.PathExpr   eval    PathExpr.java   241
org.exist.xquery.ElementConstructor eval    ElementConstructor.java 271
org.exist.xquery.AbstractExpression eval    AbstractExpression.java 61
org.exist.xquery.PathExpr   eval    PathExpr.java   241
org.exist.xquery.DebuggableExpression   eval    DebuggableExpression.java   56
org.exist.xquery.DebuggableExpression   eval    DebuggableExpression.java   63
org.exist.xquery.LetExpr    eval    LetExpr.java    208
org.exist.xquery.BindingExpression  eval    BindingExpression.java  158
org.exist.xquery.AbstractExpression eval    AbstractExpression.java 61
org.exist.xquery.PathExpr   eval    PathExpr.java   241

and I am completely at a loss as to what is going wrong.

The PHP Curl code is as follows:

$ch = curl_init();
/**
* Set the URL of the page or file to download.
*/
curl_setopt($ch, CURLOPT_URL, 'http://onlineservices.letterpart.com/sitemap.xml;jsessionid=1j1agloz5ke7l?id=1j1agloz5ke7l');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec ($ch);
curl_close ($ch);

$xml = new SimpleXMLElement($data);
foreach ($xml->url as $url_list) {
    $url = $url_list->loc;
    echo $url ."<br>"; 
    //file_get_contents($url);




    echo $url ."<br>";   
    $ch = curl_init($url); //load the urls
                    echo $url ."<br>";  
            curl_setopt($ch, CURLOPT_TIMEOUT_m2, 20); //No need to wait for it to load. Execute it and go.
            curl_exec($ch); //Execute
            curl_close($ch); //Close it off 

Can anyone help? I’m at a bit of a loss as this is way outside of my skill set.

Thanks,

EDIT:

It was suggested that I added a User Agent so I added the following:

curl_setopt($ch, CURLOPT_USERAGENT, “Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)”);

I now get the following error in my logs:

[13-May-2011 16:30:14] PHP Notice:  Use of undefined constant CURLOPT_TIMEOUT_m2 - assumed 'CURLOPT_TIMEOUT_m2' in /home/digital1/public_html/dev/sitemap.php on line 43
[13-May-2011 16:30:14] PHP Warning:  curl_setopt() [<a href='function.curl-setopt'>function.curl-setopt</a>]: Invalid curl configuration option in /home/digital1/public_html/dev/sitemap.php on line 43

The two line in question here (43) is:

curl_setopt($ch, CURLOPT_TIMEOUT_m2, 20); //No need to wait for it to load. Execute it and go.

I do seem to be having better luck using the Googlebot agent:

Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

as in I am actually getting content written to the screen but my logs are still showing these errors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:18:07+00:00Added an answer on May 22, 2026 at 2:18 am

    My immediate guess is that your Java app is expecting the User-Agent header to be set. Since Curl does not send a User-Agent header by default, you will need to set one. Try adding this above your option to set CURL_TIMEOUT_m2.

    curl_setopt($ch, CURLOPT_USERAGENT, "PHP/".PHP_VERSION );
    

    If for some reason it does not like that User-Agent string, you might want to try using one from an actual browser.

    EDIT:

    Per your edit, this is because you’ve typoed the curl timeout constant. It should be CURLOPT_TIMEOUT_MS not CURLOPT_TIMEOUT_m2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to parse an xml document and have to get all the elements
I recently changed a couple of my .xml files from docbook to dita. The
I'm working on a web app that will need to process DITA documents from
I downloaded the source code for an applet from here: http://www.oxygenxml.com/demo/AuthorDemoApplet/author-component-dita.html As instructed, I've
Have a slight problem. Trying to post XML to a server. To do this,
Have set up a small website for a client however contact form submissions are
Have been writing the shell script such as : #! /bin/bash `sqlplus -s <username>/<passwd>@dbname`
Have same challenge as this guy: How to copy dependencies to gae war/WEB-INF/lib Applying
have a wierd issue. for the life of me can't trace this back (its
Have been searching all over the internet but struggling to find my answer to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.