Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing Error - Invalid Token Due to &
Message
From
05/05/2004 15:02:31
 
 
To
05/05/2004 14:51:36
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00901300
Message ID:
00901309
Views:
33
This message has been marked as the solution to the initial question of the thread.
>That line is the value line below and when I remove the & it runs fine. How can I include the & in a value? I need to in some cases...

The & is a reserved symbol, but can be created literally like so:
&
Here's a function I have in my library that I use to XMLify everything that goes into an XML document:
* Xml Encode
* This program gets stuff ready for XML. It'll take anything. Its tough.
LPARAMETERS teExpression
LOCAL lcReturn

lcReturn = TRAN(teExpression)

IF VARTYPE(teExpression) = 'C'
	lcReturn = ALLTRIM(lcReturn)
	lcReturn = STRTRAN(lcReturn, '&', '&')
	lcReturn = STRTRAN(lcReturn, '<', '&lt;')
	lcReturn = STRTRAN(lcReturn, '>', '&gt;')
	lcReturn = STRTRAN(lcReturn, '"', '&quot;')
	lcReturn = STRTRAN(lcReturn, "'", '&apos;')
ENDIF 

RETURN lcReturn
From your last couple posts looks like you're doing a little string manipulation, eh? Fun stuff. XML'll give you a headache at first but once you learn its ins and outs the love affair will never end.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform