Google CSE: File uploading is not successful - google-custom-search

I'm getting the above error when I try uploading an auto-suggest xml file to Google's custom site search. I tried trimming the file down to the bear minimum to see if I could isolate the problem but even the following won't upload:
<?xml version="1.0" encoding="utf-8"?>
<Autocompletions>
<Autocompletion term="My term" type="1" />
</Autocompletions>
Am I missing something blindingly obvious?
Kind regards,
Karl

It turns out, despite the Google information to the contrary, that the 'language' attribute is required even if it's value is blank. I added that and the file was successfully imported.
<?xml version="1.0" encoding="utf-8"?>
<Autocompletions>
<Autocompletion term="My term" type="1" language="" />
</Autocompletions>

Make sure that your encoding is UTF-8. Also, term="" i.e. an empty term should not be there in the XML file.

Related

How to put one or several package files into a changelog in sql format

in a changelogfile (in sql mode), I want to update or create severals package.
I don't want to write all the package in 1 file.
I want to be able to do a rollback.
How can I do it ?
the oracle command "#" is not recognized.
thanks
Michel
If I understand your question correctly, it is the Include tag you are looking for.
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet id="a_changeset" author="a_developer">
<comment>Doing some stuff</comment>
...
</changeSet>
<include file="someMoreChangeSets.xml" />
</xml?
I can't use your solution because I only use sql file (myfile.sql)
I think it's not the better solution to use sql files, but I don't want to totally change "How the developpers code"
thanks
Michel

Problems with F key in .XFDF file format for merging with PDF remotely

I've been reading that there is a way to create/reference a .FDF file (used for merging data with a PDF form) that has an embedded URL to the original PDF to be filled in it, and a specifically crafted URL can be sent to the browser that will load Acrobat or related programs that will merge the FDF data with the PDF.
Presumably something like:
http://host/path/original.pdf#FDF=http://host/path/data.fdf
But I can't get that to work. Perhaps the path to the original PDF can be embedded within the .FDF file? I've heard there is something called an /F key that can be used. Can anyone give me an example of it's use, and if there is a special MIME format that is needed to have the browser recognize the file/merge, what would it be?
Here's an example of an FDF file - where do I put the original PDF url?
%FDF-1.2
%▒▒▒▒
1 0 obj
<</FDF<</F(Stand Alone EE.pdf)/Fields[
<</T(date)/V(07/11/2018)>>
<</T(uname)/V(Jennifer Smith)>>
<</T(pctbefore)/V(35)>>
<</T(aftfee)/V(40)>>
<</T(newclient)/V(Yes)>>
<</T(current_dateplus90days)/V(10/11/2018)>>
<</T(im_url)/V(http://internal_usl_for_something_else)>>
]/ID[<A3715E58793D9B5B9A48E8B2E0E057FF><BCE39B7672548444B7E6606F1B14E048>]/UF(Stand Alone EE.pdf)>>/Type/Catalog>>
endobj
trailer
<</Root 1 0 R>>
%%EOF
I have kind of given up on the .fdf format since apparently a newer version, .xfdf is available, but if either way can work, it would be great.
I have also tried this with the XFDF format as documented here:
https://forums.adobe.com/thread/425699
The problem I've run into with the XFDF version is, when I click on the .xfdf it wants to save the file locally. I checked to make sure the mime type is set in the web server and it is. But if I save the .fdf and click on it, it opens up Acrobat, which then tries to open a document in Firefox with the same URL, which then prompts me if I want to open the document in Acrobat and it keeps spawning a circle of windows in Mozilla. Any idea what's wrong?
Here's a sample .fdf
<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<f href="http://myhost/sample.pdf" />
<fields>
<field name="date"><value>07/11/2018</value></field>
<field name="atty"><value>Jennifer Smith</value></field>
<field name="typeofclaim"><value>Automobile Collision</value></field>
</fields>
</xfdf>
Anybody see anything wrong in the composition? What mime.type issues could I be having? My server is set to recognize .xfdf as "application/vnd.adobe.xfdf"
I set up a shell script to output the mime-type "application/vnd.adobe.xfdf", and then dump the content of the fxdf file above. The browser recognizes it as an Adobe app and I can open it with Acrobat, but then I get this error:
Xml parsing error: xml processing instruction not at start of external entity (error code 17) line 2 of file xxxxx.xfdf
Any idea what the error could be in the xml file? The parser says it's correct. Is it ok to terminate lines with \n?
One problem I found with the field parsing is that it's very picky about the content of the form data if it's not encapsulated in some kind of structure (i.e. CDATA) that says "leave as is", so if you have a data form field, for example, that has unbalanced parenthesis, this can cause bizarre errors.
One of my fixes was to fully-validate the form field data. And make sure things like for every open parenthesis, there were closed parenthesis. This at least fixed one of the errors.
the .XFDF format here works:
<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<f href="http://myhost/sample.pdf" />
<fields>
<field name="date"><value>07/11/2018</value></field>
<field name="atty"><value>Jennifer Smith</value></field>
<field name="typeofclaim"><value>Automobile Collision</value></field>
</fields>
</xfdf>

Align depth and rgb images for oni files

I have an oni file where depth and rgb images are not aligned. I read in other questions that in this case it is useful to use GetAlternativeViewPointCap(). However this does not work.
I tried the following code:
if (depth.IsCapabilitySupported(XN_CAPABILITY_ALTERNATIVE_VIEW_POINT)) {
depth.GetAlternativeViewPointCap().SetViewPoint(image);
}
In the xml file I tried (one of the several attempts)
....
<Recording file="file.oni" />
<Node type="Depth" >
<Query>
<Capabilities>
<Capability>Alternative View</Capability>
</Capabilities>
</Query>
<Configuration>
</Configuration>
</Node>
....
Is it possible to use GetAlternativeViewPointCap also for already recorded files?
How the xml file should be configured?
Based on the capabilities that I add I get the error: Open failed: The node is locked for changes!
Any idea?
Tks!
If you load a recording file you cannot change its Capabilities, Resolution, etc.
Configuring is only relates when connecting to a real hardware.

Remove Line Breaks in a Text File

I have created an XML file using streamWriter.. Now, i want to remove the line breaks in my XML file.. Is there a way to accomplish this task..?
here's my sample outout
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2004, v.4002-->
<!DOCTYPE primary.hierarchy SYSTEM "http://phoenix.roc.westgroup.com/dtd/pax.dtd">
Output should look like this
<?xml version="1.0" encoding="utf-8"?><!--Arbortext, Inc., 1988-2004, v.4002--><!DOCTYPE primary.hierarchy SYSTEM "http://phoenix.roc.westgroup.com/dtd/pax.dtd">
Instead of using StreamWriter you can consider using XmlWriter instead. It has various settings to deal with formatting of XML output.
See XmlWriterSettings for details
BTW. I assume that have you used WriteLine with your StreamWriter approach use Write instead. That should get rid of your line breaks.

Attribute 'strict' is not allowed to appear in element 'csv:listBinding' in smooks1.4

I am trying to read csv file using smooks1.4 . I want to check the field missmatch , for that in my smooks config file i am using strict="true".but it is throwing
error like this
cvc-complex-type.3.2.2: Attribute
'strict' is not allowed to appear in
element 'csv:listBinding'
this is my smooks-config.xml file
<?xml version="1.0" encoding="UTF-8"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd">
<csv:reader fields="firstName,lastName,welcome">
<csv:listBinding beanId="customerList" class="example.Customer" strict="true"/>
</csv:reader>
</smooks-resource-list>
My smooks releated Jar files are
milyn-commons-1.4.jar
milyn-smooks-core-1.4.jar
milyn-smooks-csv-1.4.jar
milyn-smooks-javabean-1.4.jar
milyn-smooks-templating-1.4.jar
Help will be appreciated.
You need to use the following URI for the csv namespace:
http://www.milyn.org/xsd/smooks/csv-1.3.xsd
Also, strict is an attribute of csv:reader, not csv:listBinding.