XML Error (Invalid character as tag name)

XML Error (Invalid character as tag name)

Postby pieter » Tue Jun 02, 2015 7: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: Select all  Expand view  RUN
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  Expand view  RUN

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

Re: XML Error (Invalid character as tag name)

Postby Antonio Linares » Tue Jun 02, 2015 9:17 am

Pieter,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: XML Error (Invalid character as tag name)

Postby pieter » Tue Jun 02, 2015 1: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
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Postby Antonio Linares » Tue Jun 02, 2015 3:18 pm

Pieter,

Could you try it with Harbour ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: XML Error (Invalid character as tag name)

Postby pieter » Wed Jun 03, 2015 7: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
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Postby Antonio Linares » Wed Jun 03, 2015 8:11 am

Pieter,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: XML Error (Invalid character as tag name)

Postby pieter » Wed Jun 03, 2015 8:28 am

Antonio,

Code: Select all  Expand view  RUN

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

Re: XML Error (Invalid character as tag name)

Postby cnavarro » Wed Jun 03, 2015 9:00 am

Try

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



asi

Code: Select all  Expand view  RUN


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

Re: XML Error (Invalid character as tag name)

Postby pieter » Wed Jun 03, 2015 9: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
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Postby pgfdz » Wed Jun 03, 2015 9:41 am

Helo

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

"Input/output error",

A greeting
Paco García
pgfdz
 
Posts: 145
Joined: Wed Nov 03, 2010 9:16 am

Re: XML Error (Invalid character as tag name)

Postby pieter » Wed Jun 03, 2015 9: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?
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Postby Antonio Linares » Wed Jun 03, 2015 9:54 am

Pieter,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: XML Error (Invalid character as tag name)

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

Re: XML Error (Invalid character as tag name)

Postby pieter » 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_FUN___CLSLOCKDEF' , Error: Unresolved external '_HB_FUN___CLSUNLOCKDEF' , Error: Unresolved external '_HB_FUN_FW_GT).
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: XML Error (Invalid character as tag name)

Postby Antonio Linares » Wed Jun 03, 2015 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 33 guests