Page 1 of 2

XML Error (Invalid character as tag name)

Posted: Tue Jun 02, 2015 7:20 am
by pieter
Dear Reader

I am porting my company application from Fivewin 2012 and Xharbour 1.2.1 to Fivewin 2015 and Xharbour 1.2.3.

I am searching for a solution to the following XML error: Invalid character as tag name. (The application with Fivewin 2012 and Xharbour 1.2.1 does not give such an error, only the new application with Fivewin 2015 and Xharbour 1.2.3 gives this error)

The code looks like this.

Code: Select all

CLASS KddXmlDocument FROM TXmlDocument
#include <hbxml.ch>
#include <hbclass.ch>

PUBLIC:
    METHOD New CONSTRUCTOR
    METHOD toString
    METHOD write
ENDCLASS

METHOD New( cXml,nStyle ) CLASS KddXmlDocument
    super:new( cXML,nStyle )
    IF ::nError <> HBXML_ERROR_NONE
        msginfo( "XML:" + P_LICENTIE + cXML + CRLF + HB_XmlErrorDesc( ::nError )  + Str( ::nLine) )
        msginfo( "XML:" + HB_XmlErrorDesc( ::nError ) )  //gives: Invalid character as tag name
        msginfo( "XML:" + Str( ::nLine) )  //gives: 1 
        
    ENDIF
RETURN Self
 
Maybe somebody knows what could be the problem or have some ideas in what direction I best can search. I think it has something to do with (x)harbour (and not with fivewin), because I found the error description (Invalid character as tag name) in hbxml.c (in source code of Xharbour: C:\Pieter\xharbour_snapshot\source\rtl\)

Code: Select all

static const char * edesc[] =
{
   "Input/output error",
   "Not enough memory",
   "Character outside tags",
   "Invalid character as tag name",
   "Invalid character as attribute name",
   "Malformed attribute definition",
   "Invalid character",
   "Name of tag too long",
   "Name of attribute too long",
   "Value of attribute too long",
   "Unbalanced tag closeure",
   "Unbalanced entity opening",
   "Escape/entity '&;' found"
}; 

 


Kind regards,

Pieter

Re: XML Error (Invalid character as tag name)

Posted: Tue Jun 02, 2015 9:17 am
by Antonio Linares
Pieter,

Could you copy here the error.log file ? thanks

Re: XML Error (Invalid character as tag name)

Posted: Tue Jun 02, 2015 1:49 pm
by pieter
Antonio, thanks

I could not find an error log, I think there is also not an error log which is generated.

I compiled the application with Xharbour121 and Fivewin 2015, that worked. So I think that the problem is with the new Xharbour 1.2.3 version.

Pieter

Re: XML Error (Invalid character as tag name)

Posted: Tue Jun 02, 2015 3:18 pm
by Antonio Linares
Pieter,

Could you try it with Harbour ?

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 7:39 am
by pieter
Antonio,

I tried it with harbour. First I got an error which I solved with http://fivetechsupport.com/forums/viewt ... 31&start=0, Now I get an error error e0020 incomplete statement or unbalanced delimiters.

Note: I looked in the prg file and saw that is related to XML.

Pieter

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 8:11 am
by Antonio Linares
Pieter,

Could you copy here the line that generates such error ?

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 8:28 am
by pieter
Antonio,

Code: Select all

CLASS XMLConverter
    HIDDEN:
        VAR oNextConverter
PUBLIC: //this line gives an error
    METHOD addConverter
    METHOD convert VIRTUAL
    METHOD new CONSTRUCTOR
ENDCLASS

CLASS Type2AttribConverter FROM XMLConverter
PUBLIC: //this line gives an error
    METHOD convert
PRIVATE: //this line gives an error
    METHOD convertSpecific
ENDCLASS
 
All the lines with PUBLIC: and PRIVATE: give errors (PROTECTED: gives not an error)

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 9:00 am
by cnavarro
Try
CLASS KddXmlDocument FROM TXmlDocument
#include <hbxml.ch>
#include <hbclass.ch>
asi

Code: Select all


#include <hbxml.ch>
#include <hbclass.ch>
CLASS KddXmlDocument FROM TXmlDocument

 

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 9:14 am
by pieter
hi cnvarro, thank you:D,

yes, the code was already like you suggest ( I copied and pasted the code in wrong order to this forum).

Pieter

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 9:41 am
by pgfdz
Helo

Can be the slash, that can be considerate as a special character?

"Input/output error",

A greeting

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 9:50 am
by pieter
Helo:), thank you. oké, so it could be compiler related. I will now search for the old Xharbour121 source code. (To compare the versions, especially hbxml.c) Does anybody know where I can find this source code?

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 9:54 am
by Antonio Linares
Pieter,

Remove PUBLIC: and PRIVATE: they are not really needed

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 11:41 am
by pieter
Hi Antonio,

somehow I could create an .obj, so now I can move on:D (but errors or warnings remain),

I am now searching for hbzip.lib, I can not find it in hb30\lib\win\bcc , so I am wondering what the solution is. Should I use another file instead (hbziparc.lib or hbzlib.lib) or can I download hbzip.lib somewhere?

Pieter

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 12:26 pm
by pieter
I copied all the Xharbour123/lib files to hb30/lib, so the linker could find the files. Is this a good solution if want to use harbour3.0?

I got the following errors when I linked( Error: Unresolved external '_HB_FUN___CLSLOCKDEF' , Error: Unresolved external '_HB_FUN___CLSUNLOCKDEF' , Error: Unresolved external '_HB_FUN_FW_GT).

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 6:18 pm
by Antonio Linares
Pieter,

You can not mix Harbour and xHarbour libraries, thats why you get those errors.

Please download this Harbour build and try it:
https://bitbucket.org/fivetech/harbour- ... /downloads
https://bitbucket.org/fivetech/harbour- ... 150205.zip