XML Error (Invalid character as tag name)

User avatar
pieter
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

XML Error (Invalid character as tag name)

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: XML Error (Invalid character as tag name)

Post by Antonio Linares »

Pieter,

Could you copy here the error.log file ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
pieter
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: XML Error (Invalid character as tag name)

Post by Antonio Linares »

Pieter,

Could you try it with Harbour ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
pieter
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: XML Error (Invalid character as tag name)

Post by Antonio Linares »

Pieter,

Could you copy here the line that generates such error ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
pieter
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Post 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)
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: XML Error (Invalid character as tag name)

Post 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

 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
pieter
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Post 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
pgfdz
Posts: 145
Joined: Wed Nov 03, 2010 9:16 am

Re: XML Error (Invalid character as tag name)

Post by pgfdz »

Helo

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

"Input/output error",

A greeting
Paco García
User avatar
pieter
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Post 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?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: XML Error (Invalid character as tag name)

Post by Antonio Linares »

Pieter,

Remove PUBLIC: and PRIVATE: they are not really needed
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
pieter
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Post 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
User avatar
pieter
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Post 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).
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: XML Error (Invalid character as tag name)

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply