FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XML Error (Invalid character as tag name)
Posts: 117
Joined: Thu Jan 08, 2015 09:27 AM

XML Error (Invalid character as tag name)

Posted: Tue Jun 02, 2015 07:20 AM
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 (fw): Select all Collapse
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 (fw): Select all Collapse
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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: XML Error (Invalid character as tag name)

Posted: Tue Jun 02, 2015 09:17 AM

Pieter,

Could you copy here the error.log file ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 117
Joined: Thu Jan 08, 2015 09:27 AM

Re: XML Error (Invalid character as tag name)

Posted: Tue Jun 02, 2015 01:49 PM

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

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: XML Error (Invalid character as tag name)

Posted: Tue Jun 02, 2015 03:18 PM

Pieter,

Could you try it with Harbour ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 117
Joined: Thu Jan 08, 2015 09:27 AM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 07:39 AM

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

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 08:11 AM

Pieter,

Could you copy here the line that generates such error ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 117
Joined: Thu Jan 08, 2015 09:27 AM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 08:28 AM
Antonio,

Code (fw): Select all Collapse
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)
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 09:00 AM
Try


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



asi

Code (fw): Select all Collapse
#include <hbxml.ch>
#include <hbclass.ch>
CLASS KddXmlDocument FROM TXmlDocument
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 117
Joined: Thu Jan 08, 2015 09:27 AM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 09:14 AM

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

Posts: 145
Joined: Wed Nov 03, 2010 09:16 AM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 09:41 AM

Helo

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

"Input/output error",

A greeting

Paco García
Posts: 117
Joined: Thu Jan 08, 2015 09:27 AM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 09:50 AM

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?

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 09:54 AM

Pieter,

Remove PUBLIC: and PRIVATE: they are not really needed

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 117
Joined: Thu Jan 08, 2015 09:27 AM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 11:41 AM

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

Posts: 117
Joined: Thu Jan 08, 2015 09:27 AM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 12:26 PM

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_FUNCLSLOCKDEF' , Error: Unresolved external 'HB_FUN_CLSUNLOCKDEF' , Error: Unresolved external '_HB_FUN_FW_GT).

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: XML Error (Invalid character as tag name)

Posted: Wed Jun 03, 2015 06:18 PM
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-xharbour-builds/downloads
https://bitbucket.org/fivetech/harbour-xharbour-builds/downloads/harbour_3.2_32bits_Borland582_20150205.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com