Problem with license file (CCSID)

Hi,

Well, the method is there in the latest version/fix v2.4.3.x (you may try to download and try it: http://www.aspose.com/community/files/72/java-components/aspose.cells-for-java/default.aspx).
http://www.aspose.com/documentation/java-components/aspose.cells-for-java/com/aspose/cells/license.html

Thank you.

Hi,
We have tried to set file.encoding=cp1140 and found the license can be set successfully by License.setLicense(InputStream), where the stream is a FileInputStream built from the license file. And we need no any extra code to process the encoding. Are you using the original license file or have modified the file mannually? And would you please test the sample code we provided in previous reply(http://www.aspose.com/community/forums/permalink/270963/270563/showthread.aspx#270563) to check whether the xml can be parsed successfully? The result of this test can help us to find what's the problem.
Thank you.

Ok, I'll have a try.

Could there be a problem with the CRLF ? I always get error "Fatal Error| :2:1: Content is not allowed in prolog." --> Line 2 position 1

When I try to parse the xml, I get error :"Fatal Error| :2:1: Content is not allowed in prolog. "

Error on lin 2 pos 1 : Could there be a problem with the CRLF ?

Hi,

We are not sure what could be the reason for your problem. We think we need your license file to give a test here. Do not attach or post license file here. To email your license file, please follow the below mentioned steps:

1: click the Contact button in the Post

2: In the drop down list options click "Send Amjad Sahi an Email”.

3: Attach the license file and send it (you may zip the files prior attaching it).

4: Once you have done it, kindly confirm us here in this thread.


Thank you.


I changed my code to manually convert to UTF-8.

The XML-parsing works fine --> NO errors

setLicense ends with error : ¬Fatal Error| :-1:-1: Premature end of file.

HGOAS4:

I changed my code to manually convert to UTF-8.

The XML-parsing works fine --> NO errors

setLicense ends with error : ¬Fatal Error| :-1:-1: Premature end of file.

Maybe I cannot do setLicense after the XML-parsing ?

When I only do the setLicense, I don't see any errors in STDERR, but setLicense ends in error ?

Parsing the xml works fine ! (several tests)

I assume the problem occurs when the parsed data is processed.

Is the parsed data handled as UTF-8 data or does the file.encoding interfere there somewhere ?

Hi,

We received your license file.

We tested your license file with file.encoding=Cp1140 and found no error at all of parsing it. But because the license file’s expired date is 2008-05-15, setLicense() will throw an exception for the expired license when you use latest fix/version. Would you please share us your code to make the parsing of xml work fine? According to your code, maybe we can give a solution for the issue of parsing license file in setLicense() procedure.

Thank you.

Hello,

Any progress on this problem ?

Thanks !

Hi Hendrik,

We are working on the issue. Please share the code which you have used to successfully parsed the license file as xml.

Thanks,

// Test XML-parsing

O_DocBuildFact = DocumentBuilderFactory$newInstance(); O_DocBuild=DocumentBuilderFactory$newDocumentBuilder(o_DocBuildFact);

O_Doc = DocumentBuilder$Parse(O_DocBuild:O_ByteArrInpStream);

Some more info :

When I retrieve the nodes from the xml-document I also get some "#text"-nodes with unreadable characters (CRLF I assume) !

Is this normal ?

Thanks !

<!–[if gte mso 10]> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

<![endif]–>

Hi,


It is really strange, what we have done in License.setLicense(InputStream) is just the same with your logic but you still get the error when calling this method. Anyways, we have added one method License.setLicense(Reader) for you to test whether it can solve your problem of the encoding. Please try this new fix (attached) for the new API.


Thank you.

Thanks,


I’ll have a try tomorrow.

I still have the same problems !

I don’t understand it.

Thx
<!–[if gte mso 10]> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

<![endif]–>

Hi,

You said in your previous post that when you retrieve nodes from the parsed xml-document, you still get some errors. I am afraid the xml file was not parsed correctly by your code even though there was not any error produced while parsing it. Would you please try again to parse the xml file with your own code without referencing to Aspose.Cells for Java? If you can retrieve all nodes and their contents from the parsed xml-document successfully, we can try to use the same logic for you to parse the license file when setting license.

Thank you.

Amjad Sahi:

Hi,

You said in your previous post that when you retrieve nodes from the parsed xml-document, you still get some errors. I am afraid the xml file was not parsed correctly by your code even though there was not any error produced while parsing it. Would you please try again to parse the xml file with your own code without referencing to Aspose.Cells for Java? If you can retrieve all nodes and their contents from the parsed xml-document successfully, we can try to use the same logic for you to parse the license file when setting license.

Thank you.

I parsed the xml like this.

Keep me informed !

Thanks

// Test XML-parsing

O_DocBuildFact = DocumentBuilderFactory$newInstance();

O_DocBuild=DocumentBuilderFactory$newDocumentBuilder(o_DocBuildFact);

O_Doc = DocumentBuilder$Parse(O_DocBuild:O_InStream);

O_Nodelist = Node$getChildNodes(O_Doc);

lLen = NodeList$getLength(O_NodeList);

gJStrg$ = StringtoJstring('/Home/UHG011/Stdout.txt');

O_PrintWriter = newPrintWriter(gJStrg$);

freelocalref(gJStrg$);

For lIdx=0 to lLen-1;

o_node = NodeList$Item(o_NodeList:lIdx);

If o_Node <> *Null;

gJStrg$ = node$getNodeName(o_Node);

If gJStrg$<>*Null;

lNode = jStringtoAlpha(gJstrg$);

PrintWriter$print(O_PrintWriter:gJStrg$);

freelocalref(gJStrg$);

EndIf;

gJStrg$ = node$getNodeValue(o_Node);

If gJStrg$<>*Null;

lVal = jStringtoAlpha(gJstrg$);

PrintWriter$print(O_PrintWriter:gJStrg$);

freelocalref(gJStrg$);

EndIf;

getChildNodes();

EndIf;

ENDFOR;

PgetChildNodes b

D lo_NodeList s Like(O_NodeList) Inz(*Null)

D lIdx s 10u 0 Inz

D lNode s 256a Inz

D lVal s 256a Inz

D lLen s 10I 0 Inz

/Free

lO_Nodelist = Node$getChildNodes(O_Node);

If lO_NodeList = *Null;

Return;

ENDIF;

lLen = NodeList$getLength(lo_NodeList);

For lIdx=0 to lLen-1;

o_node = NodeList$Item(lo_NodeList:lIdx);

If o_Node <> *Null;

gJStrg$ = node$getNodeName(o_Node);

If gJStrg$ <> *Null;

lNode = jStringtoAlpha(gJstrg$);

PrintWriter$print(O_PrintWriter:gJStrg$);

freelocalref(gJStrg$);

EndIf;

gJStrg$ = node$getNodeValue(o_Node);

If gJStrg$ <> *Null;

lVal= jStringtoAlpha(gJstrg$);

PrintWriter$print(O_PrintWriter:gJStrg$);

freelocalref(gJStrg$);

EndIf;

getChildNodes();

EndIf;

ENDFOR;

/End-Free

P e

Hi,

It is really strange. From your code we did not find any significant difference from our procedure of parsing xml. We have created a sample java program for testing this encoding issue, in fact what it does is same with what you have done in your sample code. See the attached TestXML.java file. Would you please invoke parseXML(InputStream, OutputStream) method in your code to test whether it can parse the license file well? Also, you can run it as a standard Java application to test the encoding issue.

Thank you.

Amjad Sahi:
Hi,

It is really strange. From your code we did not find any significant difference from our procedure of parsing xml. We have created a sample java program for testing this encoding issue, in fact what it does is same with what you have done in your sample code. See the attached TestXML.java file. Would you please invoke parseXML(InputStream, OutputStream) method in your code to test whether it can parse the license file well? Also, you can run it as a standard Java application to test the encoding issue.

Thank you.

Thanks again !
I will test this next week.